Jackie-Jiang commented on code in PR #15350:
URL: https://github.com/apache/pinot/pull/15350#discussion_r2116869296


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -393,6 +393,18 @@ public IndexLoadingConfig fetchIndexLoadingConfig() {
     return indexLoadingConfig;
   }
 
+  public void refreshCachedTableSchema() {
+    Schema schema = ZKMetadataProvider.getTableSchema(_propertyStore, 
_tableNameWithType);
+    Preconditions.checkState(schema != null, "Failed to find schema for table: 
%s", _tableNameWithType);
+    // Update the cached table config and schema with the latest schema
+    TableConfig tableConfig = _cachedTableConfigAndSchema.getLeft();
+    if (tableConfig == null) {
+      tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, 
_tableNameWithType);
+      Preconditions.checkState(tableConfig != null, "Failed to find table 
config for table: %s", _tableNameWithType);
+    }

Review Comment:
   This branch should never be hit



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -393,6 +393,18 @@ public IndexLoadingConfig fetchIndexLoadingConfig() {
     return indexLoadingConfig;
   }
 
+  public void refreshCachedTableSchema() {
+    Schema schema = ZKMetadataProvider.getTableSchema(_propertyStore, 
_tableNameWithType);
+    Preconditions.checkState(schema != null, "Failed to find schema for table: 
%s", _tableNameWithType);
+    // Update the cached table config and schema with the latest schema
+    TableConfig tableConfig = _cachedTableConfigAndSchema.getLeft();
+    if (tableConfig == null) {
+      tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, 
_tableNameWithType);
+      Preconditions.checkState(tableConfig != null, "Failed to find table 
config for table: %s", _tableNameWithType);
+    }

Review Comment:
   Consider just refresh both table config and schema given the update 
frequency should be very low, then we can also send a message when table config 
is updated



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/H3InclusionIndexFilterOperator.java:
##########
@@ -70,10 +70,10 @@ public H3InclusionIndexFilterOperator(IndexSegment segment, 
QueryContext queryCo
     _isPositiveCheck = BooleanUtils.toBoolean(eqPredicate.getValue());
 
     if (arguments.get(0).getType() == ExpressionContext.Type.IDENTIFIER) {
-      _h3IndexReader = 
segment.getDataSource(arguments.get(0).getIdentifier()).getH3Index();
+      _h3IndexReader = segment.getDataSource(arguments.get(0).getIdentifier(), 
queryContext.getSchema()).getH3Index();

Review Comment:
   This one shouldn't try to use virtual data source. Same for some other 
invocations. Please double check all the usages



-- 
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