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



##########
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, in thinking about your comment I realized there is a bug here. The 
code doesn't work right if you have a UnionDataSource of a single 
TableDataSource. I'll fix it and add a test for this, and while doing so, I'll 
consider your comments about how to structure the code.
   
   Thanks for the comments!




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



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

Reply via email to