public class FrameBasedInlineDataSource extends Object implements DataSource
The rows are backed by a sequence of FrameSignaturePair, which contain the Frame representation of the rows
represented by the datasource.
Note that the signature of the datasource can be different from the signatures of the constituent frames that it
consists of. While fetching the iterables, it is the job of this class to make sure that the rows correspond to the
rowSignature. For frames that donot contain the columns present in the rowSignature, they are
populated with null.
| Constructor and Description |
|---|
FrameBasedInlineDataSource(List<FrameSignaturePair> frames,
RowSignature rowSignature) |
| Modifier and Type | Method and Description |
|---|---|
Function<SegmentReference,SegmentReference> |
createSegmentMapFunction(Query query,
AtomicLong cpuTimeAcc)
Returns a segment function on to how to segment should be modified.
|
DataSourceAnalysis |
getAnalysis()
Get the analysis for a data source
|
byte[] |
getCacheKey()
Compute a cache key prefix for a data source.
|
List<DataSource> |
getChildren()
Returns datasources that this datasource depends on.
|
List<FrameSignaturePair> |
getFrames() |
Sequence<Object[]> |
getRowsAsSequence() |
RowSignature |
getRowSignature() |
Set<String> |
getTableNames()
Returns the names of all table datasources involved in this query.
|
boolean |
isCacheable(boolean isBroker)
Returns true if queries on this dataSource are cacheable at both the result level and per-segment level.
|
boolean |
isConcrete()
Returns true if this datasource can be the base datasource of query processing.
|
boolean |
isGlobal()
Returns true if all servers have a full copy of this datasource.
|
DataSource |
withChildren(List<DataSource> children)
Return a new DataSource, identical to this one, with different children.
|
DataSource |
withUpdatedDataSource(DataSource newSource)
Returns an updated datasource based on the specified new source.
|
public FrameBasedInlineDataSource(List<FrameSignaturePair> frames, RowSignature rowSignature)
public List<FrameSignaturePair> getFrames()
public RowSignature getRowSignature()
public Set<String> getTableNames()
DataSourcegetTableNames in interface DataSourcepublic List<DataSource> getChildren()
DataSourcegetChildren in interface DataSourcepublic DataSource withChildren(List<DataSource> children)
DataSourcewithChildren in interface DataSourcepublic boolean isCacheable(boolean isBroker)
DataSourceisCacheable in interface DataSourcepublic boolean isGlobal()
DataSource
Currently this is coupled with joinability - if this returns true then the query engine expects there exists a
JoinableFactory which might build a
Joinable 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.
isGlobal in interface DataSourcepublic boolean isConcrete()
DataSourceTableDataSource, for example, queries
are processed in parallel on data servers. If the base datasource is InlineDataSource, queries are
processed on the Broker. See DataSourceAnalysis.getBaseDataSource() for further discussion.
Datasources that are *not* concrete must be pre-processed in some way before they can be processed by the main
query stack. For example, QueryDataSource must be executed first and substituted with its results.isConcrete in interface DataSourcewhich uses this,
which uses thispublic Function<SegmentReference,SegmentReference> createSegmentMapFunction(Query query, AtomicLong cpuTimeAcc)
DataSourcecreateSegmentMapFunction in interface DataSourcequery - the input querycpuTimeAcc - the cpu time accumulatorpublic DataSource withUpdatedDataSource(DataSource newSource)
DataSourcewithUpdatedDataSource in interface DataSourcenewSource - the new datasource to be used to update an existing querypublic byte[] getCacheKey()
DataSourcePreJoinableClause
- NULL - There is a join but caching is not possible. It may happen if one of the participating datasource
in the JOIN is not cacheable.getCacheKey in interface DataSourcepublic DataSourceAnalysis getAnalysis()
DataSourcegetAnalysis in interface DataSourceDataSourceAnalysis object for the callee data sourceCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.