clintropolis commented on a change in pull request #9235: Add join-related
DataSource types, and analysis functionality.
URL: https://github.com/apache/druid/pull/9235#discussion_r369254935
##########
File path: processing/src/main/java/org/apache/druid/query/UnionDataSource.java
##########
@@ -52,6 +57,51 @@ public UnionDataSource(@JsonProperty("dataSources")
List<TableDataSource> dataSo
return dataSources;
}
+ @Override
+ public List<DataSource> getChildren()
+ {
+ return ImmutableList.copyOf(dataSources);
+ }
+
+ @Override
+ public DataSource withChildren(List<DataSource> children)
+ {
+ if (children.size() != dataSources.size()) {
+ throw new IAE("Expected [%d] children, got [%d]", dataSources.size(),
children.size());
+ }
+
+ if (!children.stream().allMatch(dataSource -> dataSource instanceof
TableDataSource)) {
+ throw new IAE("All children must be tables");
+ }
+
+ return new UnionDataSource(
+ children.stream().map(dataSource -> (TableDataSource)
dataSource).collect(Collectors.toList())
+ );
+ }
+
+ @Override
+ public boolean isCacheable()
+ {
+ // Disables result-level caching for 'union' datasources, which doesn't
work currently.
+ // See https://github.com/apache/druid/issues/8713 for reference.
Review comment:
:+1: this seems like a good intermediary solution until we fix the issue for
real
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]