Package org.apache.calcite.adapter.clone
Class ColumnLoader<T>
- java.lang.Object
-
- org.apache.calcite.adapter.clone.ColumnLoader<T>
-
- Type Parameters:
T
- Element type of source table
class ColumnLoader<T> extends java.lang.Object
Column loader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ColumnLoader.Kev
Key-value pair.(package private) static class
ColumnLoader.ValueSet
Set of values of a column, created during the load process, and converted to a serializable (and more compact) form before load completes.
-
Field Summary
Fields Modifier and Type Field Description (package private) static int[]
INT_B
(package private) static int[]
INT_S
java.util.List<T>
list
(package private) static long[]
LONG_B
(package private) static int[]
LONG_S
java.util.List<ArrayTable.Column>
representationValues
int
sortField
private JavaTypeFactory
typeFactory
-
Constructor Summary
Constructors Constructor Description ColumnLoader(JavaTypeFactory typeFactory, Enumerable<T> sourceTable, RelProtoDataType protoRowType, java.util.List<org.apache.calcite.avatica.ColumnMetaData.Rep> repList)
Creates a column loader, and performs the load.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int[]
invert(int[] targets)
(package private) static boolean
isIdentity(int[] sources)
private void
load(RelDataType elementType, java.util.List<org.apache.calcite.avatica.ColumnMetaData.Rep> repList, int[] sort)
(package private) static int
log2(int v)
(package private) static int
log2(long v)
(package private) static int
nextPowerOf2(int v)
(package private) static long
nextPowerOf2(long v)
int
size()
private static java.util.List
wrap(org.apache.calcite.avatica.ColumnMetaData.Rep rep, java.util.List list, RelDataType type)
Adapt for some types that we represent differently internally than their JDBC types.
-
-
-
Field Detail
-
INT_B
static final int[] INT_B
-
INT_S
static final int[] INT_S
-
LONG_B
static final long[] LONG_B
-
LONG_S
static final int[] LONG_S
-
list
public final java.util.List<T> list
-
representationValues
public final java.util.List<ArrayTable.Column> representationValues
-
typeFactory
private final JavaTypeFactory typeFactory
-
sortField
public final int sortField
-
-
Constructor Detail
-
ColumnLoader
ColumnLoader(JavaTypeFactory typeFactory, Enumerable<T> sourceTable, RelProtoDataType protoRowType, java.util.List<org.apache.calcite.avatica.ColumnMetaData.Rep> repList)
Creates a column loader, and performs the load.- Parameters:
typeFactory
- Type factorysourceTable
- Source dataprotoRowType
- Logical row typerepList
- Physical row types, or null if not known
-
-
Method Detail
-
nextPowerOf2
static int nextPowerOf2(int v)
-
nextPowerOf2
static long nextPowerOf2(long v)
-
log2
static int log2(int v)
-
log2
static int log2(long v)
-
invert
static int[] invert(int[] targets)
-
isIdentity
static boolean isIdentity(int[] sources)
-
size
public int size()
-
load
private void load(RelDataType elementType, java.util.List<org.apache.calcite.avatica.ColumnMetaData.Rep> repList, int[] sort)
-
wrap
private static java.util.List wrap(org.apache.calcite.avatica.ColumnMetaData.Rep rep, java.util.List list, RelDataType type)
Adapt for some types that we represent differently internally than their JDBC types.Timestamp
values that are not null are converted tolong
, but nullable timestamps are acquired usingResultSet.getObject(int)
and therefore the Timestamp value needs to be converted to aLong
. SimilarlyDate
andTime
values toInteger
.
-
-