Package org.apache.calcite.avatica
Class Meta.Frame
- java.lang.Object
-
- org.apache.calcite.avatica.Meta.Frame
-
- Enclosing interface:
- Meta
public static class Meta.Frame extends java.lang.ObjectA collection of rows.
-
-
Field Summary
Fields Modifier and Type Field Description booleandoneWhether this is definitely the last frame of rows.static Meta.FrameEMPTYFrame that has zero rows and is the last frame.private static com.google.protobuf.Descriptors.FieldDescriptorHAS_ARRAY_VALUE_DESCRIPTORstatic Meta.FrameMOREFrame that has zero rows but may have another frame.longoffsetZero-based offset of first row.java.lang.Iterable<java.lang.Object>rowsThe rows.private static com.google.protobuf.Descriptors.FieldDescriptorSCALAR_VALUE_DESCRIPTOR
-
Constructor Summary
Constructors Constructor Description Frame(long offset, boolean done, java.lang.Iterable<java.lang.Object> rows)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Meta.Framecreate(long offset, boolean done, java.util.List<java.lang.Object> rows)(package private) static java.lang.ObjectdeserializeScalarValue(Common.TypedValue protoElement)private static booleanequalRows(java.lang.Iterable<java.lang.Object> rows, java.lang.Iterable<java.lang.Object> otherRows)booleanequals(java.lang.Object o)static Meta.FramefromProto(Common.Frame proto)inthashCode()(package private) static booleanisNewStyleColumn(Common.ColumnValue column)Determines whether this message contains the new attributes in the message.(package private) static java.lang.ObjectparseArray(Common.TypedValue array)Recursively parses a TypedValue while it is an array.(package private) static java.lang.ObjectparseColumn(Common.ColumnValue column)Parses the value for a ColumnValue using the separated array and scalar attributes.(package private) static voidparseColumn(Common.Row.Builder rowBuilder, java.lang.Object column)(package private) static java.lang.ObjectparseOldStyleColumn(Common.ColumnValue column)For Calcite 1.5, we made the mistake of using array length to determine when the value for a column is a scalar or an array.(package private) static Common.TypedValueserializeScalar(java.lang.Object element)Common.FrametoProto()(package private) static voidvalidateColumnValue(Common.ColumnValue column)Verifies that a ColumnValue has only a scalar or array value, not both and not neither.
-
-
-
Field Detail
-
HAS_ARRAY_VALUE_DESCRIPTOR
private static final com.google.protobuf.Descriptors.FieldDescriptor HAS_ARRAY_VALUE_DESCRIPTOR
-
SCALAR_VALUE_DESCRIPTOR
private static final com.google.protobuf.Descriptors.FieldDescriptor SCALAR_VALUE_DESCRIPTOR
-
EMPTY
public static final Meta.Frame EMPTY
Frame that has zero rows and is the last frame.
-
MORE
public static final Meta.Frame MORE
Frame that has zero rows but may have another frame.
-
offset
public final long offset
Zero-based offset of first row.
-
done
public final boolean done
Whether this is definitely the last frame of rows. If true, there are no more rows. If false, there may or may not be more rows.
-
rows
public final java.lang.Iterable<java.lang.Object> rows
The rows.
-
-
Method Detail
-
create
public static Meta.Frame create(long offset, boolean done, java.util.List<java.lang.Object> rows)
-
toProto
public Common.Frame toProto()
-
parseColumn
static void parseColumn(Common.Row.Builder rowBuilder, java.lang.Object column)
-
serializeScalar
static Common.TypedValue serializeScalar(java.lang.Object element)
-
fromProto
public static Meta.Frame fromProto(Common.Frame proto)
-
isNewStyleColumn
static boolean isNewStyleColumn(Common.ColumnValue column)
Determines whether this message contains the new attributes in the message. We can't directly test for the negative because ourhasFieldtrick does not work on repeated fields.- Parameters:
column- The protobuf column object- Returns:
- True if the message is the new style, false otherwise.
-
parseOldStyleColumn
static java.lang.Object parseOldStyleColumn(Common.ColumnValue column)
For Calcite 1.5, we made the mistake of using array length to determine when the value for a column is a scalar or an array. This method performs the old parsing for backwards compatibility.- Parameters:
column- The protobuf ColumnValue object- Returns:
- The parsed value for this column
-
parseColumn
static java.lang.Object parseColumn(Common.ColumnValue column)
Parses the value for a ColumnValue using the separated array and scalar attributes.- Parameters:
column- The protobuf ColumnValue object- Returns:
- The parse value for this column
-
parseArray
static java.lang.Object parseArray(Common.TypedValue array)
Recursively parses a TypedValue while it is an array.
-
validateColumnValue
static void validateColumnValue(Common.ColumnValue column)
Verifies that a ColumnValue has only a scalar or array value, not both and not neither.- Parameters:
column- The protobuf ColumnValue object- Throws:
java.lang.IllegalArgumentException- When the above condition is not met
-
deserializeScalarValue
static java.lang.Object deserializeScalarValue(Common.TypedValue protoElement)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
equalRows
private static boolean equalRows(java.lang.Iterable<java.lang.Object> rows, java.lang.Iterable<java.lang.Object> otherRows)
-
-