Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • 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 factory
        sourceTable - Source data
        protoRowType - Logical row type
        repList - 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 to long, but nullable timestamps are acquired using ResultSet.getObject(int) and therefore the Timestamp value needs to be converted to a Long. Similarly Date and Time values to Integer.