cecemei commented on code in PR #17864:
URL: https://github.com/apache/druid/pull/17864#discussion_r2031608970
##########
processing/src/main/java/org/apache/druid/query/metadata/metadata/SegmentMetadataQuery.java:
##########
@@ -107,7 +110,17 @@ 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 instanceof RestrictedDataSource) {
+ Policy policy = ((RestrictedDataSource) dataSource).getPolicy();
+ // Only no-restriction policy is allowed for segment metadata queries.
+ if (!(policy instanceof NoRestrictionPolicy)) {
+ throw InvalidInput.exception(
+ "Only NoRestrictionPolicy is allowed for SegmentMetadataQuery on
dataSource[%s], found policy[%s].",
+ ((RestrictedDataSource) dataSource).getBase(),
+ policy
+ );
+ }
+ } else if (!(dataSource instanceof TableDataSource || dataSource
instanceof UnionDataSource)) {
Review Comment:
actually i was wrong, union is supported for query, just not directly for
the walker. yea i can add a test case to make it fail for union of a real
restriction.
--
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]