walterddr commented on code in PR #11234:
URL: https://github.com/apache/pinot/pull/11234#discussion_r1284544009


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java:
##########
@@ -391,32 +359,39 @@ private ColocatedTableInfo getColocatedTableInfo(String 
tableName) {
         }
         return new ColocatedTableInfo(colocatedPartitionInfoMap, 
timeBoundaryInfo);
       } else if (offlineRoutingExists) {
-        return getOfflineColocatedTableInfo(offlineTableName);
+        return getOfflineColocatedTableInfo(offlineTableName, partitionKey, 
numPartitions);
       } else {
-        return getRealtimeColocatedTableInfo(realtimeTableName);
+        return getRealtimeColocatedTableInfo(realtimeTableName, partitionKey, 
numPartitions);
       }
     } else {
       if (tableType == TableType.OFFLINE) {
-        return getOfflineColocatedTableInfo(tableName);
+        return getOfflineColocatedTableInfo(tableName, partitionKey, 
numPartitions);
       } else {
-        return getRealtimeColocatedTableInfo(tableName);
+        return getRealtimeColocatedTableInfo(tableName, partitionKey, 
numPartitions);
       }
     }
   }
 
-  private TablePartitionInfo getTablePartitionInfo(String tableNameWithType) {
+  private TablePartitionInfo getTablePartitionInfo(String tableNameWithType, 
String partitionKey, int numPartitions) {
     TablePartitionInfo tablePartitionInfo = 
_routingManager.getTablePartitionInfo(tableNameWithType);
     Preconditions.checkState(tablePartitionInfo != null, "Failed to find table 
partition info for table: %s",
         tableNameWithType);
+    
Preconditions.checkState(tablePartitionInfo.getPartitionColumn().equals(partitionKey),
+        "Partition key: %s does not match partition column: %s for table: %s", 
partitionKey,
+        tablePartitionInfo.getPartitionColumn(), tableNameWithType);
+    Preconditions.checkState(tablePartitionInfo.getNumPartitions() == 
numPartitions,

Review Comment:
   yes technically speaking the table partition hint is used for 2 reasons 
(mixed)
   1. to indicate what's the table partition - which we can in the future 
improved to be automatic
   2. indicate that data is already partitioned and no need to reshuffle the 
data when unnecessary - this we can debate whether we want to create a new hint 
for such behavior change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to