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