Package org.apache.druid.frame.read
Class FrameReader
- java.lang.Object
-
- org.apache.druid.frame.read.FrameReader
-
public class FrameReader extends Object
Embeds the logic to read frames with a givenRowSignature
.Stateless and immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnCapabilities
columnCapabilities(Frame frame, String columnName)
Returns capabilities for a particular column in a particular frame.static FrameReader
create(RowSignature signature)
Create a reader for frames with a givenRowSignature
.FrameComparisonWidget
makeComparisonWidget(Frame frame, List<KeyColumn> keyColumns)
Create aFrameComparisonWidget
for the given frame.CursorFactory
makeCursorFactory(Frame frame)
Create aCursorFactory
for the given frame.RowSignature
signature()
-
-
-
Method Detail
-
create
public static FrameReader create(RowSignature signature)
Create a reader for frames with a givenRowSignature
. The signature must exactly match the frames to be read, or else behavior is undefined. If the columnType is null, we store the data asColumnType.NESTED_DATA
. This can be done if we know that the data that we receive can be serded generically using the nested data. It is currently used in the brokers to store the data with unknown types into frames.- Parameters:
signature
- signature used to generate the reader
-
signature
public RowSignature signature()
-
columnCapabilities
@Nullable public ColumnCapabilities columnCapabilities(Frame frame, String columnName)
Returns capabilities for a particular column in a particular frame.Preferred over
RowSignature.getColumnCapabilities(String)
when reading a particular frame, because this method has more insight into what's actually going on with that specific frame (nulls, multivalue, etc). The RowSignature version is based solely on type.
-
makeCursorFactory
public CursorFactory makeCursorFactory(Frame frame)
Create aCursorFactory
for the given frame.
-
makeComparisonWidget
public FrameComparisonWidget makeComparisonWidget(Frame frame, List<KeyColumn> keyColumns)
Create aFrameComparisonWidget
for the given frame.Only possible for frames of type
FrameType.ROW_BASED
. The provided sortColumns must be a prefix ofsignature()
.
-
-