cecemei commented on code in PR #17864:
URL: https://github.com/apache/druid/pull/17864#discussion_r2033819351


##########
processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentMetadataQuery.java:
##########
@@ -107,7 +109,19 @@ public SegmentMetadataQuery(
     this.toInclude = toInclude == null ? new AllColumnIncluderator() : 
toInclude;
     this.merge = merge == null ? false : merge;
     this.analysisTypes = analysisTypes;
-    if (!(dataSource instanceof TableDataSource || dataSource instanceof 
UnionDataSource)) {
+
+    if (dataSource.getClass().equals(RestrictedDataSource.class)) {
+      // Only no-restriction policy is allowed for segment metadata queries.
+      validateWithNoRestrictionPolicy((RestrictedDataSource) dataSource);
+    } else if (dataSource.getClass().equals(UnionDataSource.class)) {
+      // Verify that all children of the union data source are either table or 
restricted data sources with no-restriction policy.
+      dataSource.getChildren()

Review Comment:
   I didn't realize union can have non-table as a child, which would have 
thrown in `getDataSourcesAsTableDataSources`. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to