You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "cryptoe (via GitHub)" <gi...@apache.org> on 2025/05/29 09:17:09 UTC
Re: [PR] Handle RestrictedDataSource with NoRestrictionPolicy in PreJoinableClause, and SegmentMetadataQuery from druid-internal now attaches a policy (druid)
cryptoe commented on code in PR #18042:
URL: https://github.com/apache/druid/pull/18042#discussion_r2113554618
##########
processing/src/main/java/org/apache/druid/query/planning/PreJoinableClause.java:
##########
@@ -64,6 +68,29 @@ public DataSource getDataSource()
return dataSource;
}
+ /**
+ * If the data source is a {@link RestrictedDataSource} with a {@link NoRestrictionPolicy}, unwraps it to a table and return.
+ * <p>
+ * This is a temporary workaround to allow the planner to work with {@link RestrictedDataSource} as the right-side join.
+ */
+ public DataSource maybeUnwrapRestrictedDataSource()
+ {
+ if (dataSource instanceof RestrictedDataSource) {
+ RestrictedDataSource restricted = (RestrictedDataSource) dataSource;
+ if (restricted.getPolicy() instanceof NoRestrictionPolicy) {
+ return restricted.getBase();
+ } else {
+ throw new QueryUnsupportedException(StringUtils.format(
Review Comment:
Should this be a different error like https://github.com/apache/druid/blob/da0b404aa214494c3fa1ed24d8b0b2ff49cac331/processing/src/main/java/org/apache/druid/error/DruidException.java#L166
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org