You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/08/26 16:47:05 UTC

[GitHub] [druid] gianm commented on a change in pull request #10318: Fix handling of 'join' on top of 'union' datasources.

gianm commented on a change in pull request #10318:
URL: https://github.com/apache/druid/pull/10318#discussion_r477443081



##########
File path: processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
##########
@@ -41,30 +42,27 @@ public UnionQueryRunner(
   public Sequence<T> run(final QueryPlus<T> queryPlus, final ResponseContext responseContext)
   {
     Query<T> query = queryPlus.getQuery();
-    DataSource dataSource = query.getDataSource();
-    if (dataSource instanceof UnionDataSource) {
+
+    final DataSourceAnalysis analysis = DataSourceAnalysis.forDataSource(query.getDataSource());
+
+    if (analysis.isConcreteTableBased() && analysis.getBaseTableDataSources().get().size() != 1) {

Review comment:
       Hmm, I was trying to avoid using `instanceof` checks outside of the DataSourceAnalysis class, and instead stick to cleanly defined interfaces as much as possible. So, I designed dataSourceAnalysis.getBaseTableDataSources() to encapsulate this logic (it has the `instanceof` check you're talking about).
   
   Do you think it'd be better to instead move the logic to UnionQueryRunner?




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

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