Package org.apache.druid.query
Class GlobalTableDataSource
- java.lang.Object
-
- org.apache.druid.query.TableDataSource
-
- org.apache.druid.query.GlobalTableDataSource
-
- All Implemented Interfaces:
DataSource
public class GlobalTableDataSource extends TableDataSource
TableDataSource
variant for globally available 'broadcast' segments. If bound to aJoinableFactory
that can create anIndexedTable
using DruidBinders.joinableFactoryBinder, this allows optimal usage of segments using this DataSource type in join operations (because they are global), and so can be pushed down to historicals as aJoinDataSource
, instead of requiring a subquery join usingInlineDataSource
to construct anIndexedTable
on the fly on the broker. Because it is also aTableDataSource
, when queried directly, or on the left hand side of a join, they will be treated as any normal table datasource.
-
-
Constructor Summary
Constructors Constructor Description GlobalTableDataSource(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isCacheable(boolean isBroker)
Query results from Broadcast datasources should not be cached on broker https://github.com/apache/druid/issues/10444boolean
isGlobal()
Returns true if all servers have a full copy of this datasource.String
toString()
-
Methods inherited from class org.apache.druid.query.TableDataSource
create, createSegmentMapFunction, equals, getAnalysis, getCacheKey, getChildren, getName, getTableNames, hashCode, isConcrete, withChildren, withUpdatedDataSource
-
-
-
-
Constructor Detail
-
GlobalTableDataSource
public GlobalTableDataSource(String name)
-
-
Method Detail
-
isGlobal
public boolean isGlobal()
Description copied from interface:DataSource
Returns true if all servers have a full copy of this datasource. True for things like inline, lookup, etc, or for queries of those.Currently this is coupled with joinability - if this returns true then the query engine expects there exists a
JoinableFactory
which might build aJoinable
for this datasource directly. If a subquery 'inline' join is required to join this datasource on the right hand side, then this value must be false for now.In the future, instead of directly using this method, the query planner and engine should consider
JoinableFactory.isDirectlyJoinable(DataSource)
when determining if the right hand side is directly joinable, which would allow decoupling this property from joins.- Specified by:
isGlobal
in interfaceDataSource
- Overrides:
isGlobal
in classTableDataSource
-
isCacheable
public boolean isCacheable(boolean isBroker)
Query results from Broadcast datasources should not be cached on broker https://github.com/apache/druid/issues/10444- Specified by:
isCacheable
in interfaceDataSource
- Overrides:
isCacheable
in classTableDataSource
-
toString
public String toString()
- Overrides:
toString
in classTableDataSource
-
-