OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.calcite.parser.HeavyDBTable Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.HeavyDBTable:
+ Collaboration diagram for com.mapd.calcite.parser.HeavyDBTable:

Public Member Functions

long getVersion ()
 
 HeavyDBTable (TTableDetails ri)
 
RelDataType getRowType (RelDataTypeFactory rdtf)
 
Statistic getStatistic ()
 
Schema.TableType getJdbcTableType ()
 
boolean isRolledUp (String string)
 
boolean rolledUpColumnValidInsideAgg (String string, SqlCall sc, SqlNode sn, CalciteConnectionConfig ccc)
 
boolean isSystemColumn (final String columnName)
 

Static Package Attributes

static final Logger HEAVYDBLOGGER = LoggerFactory.getLogger(HeavyDBTable.class)
 

Private Member Functions

RelDataType createType (TColumnType value, RelDataTypeFactory typeFactory)
 
RelDataType getRelDataType (TDatumType dType, int precision, int scale, RelDataTypeFactory typeFactory)
 

Private Attributes

final TTableDetails rowInfo
 
final long version = VERSION_PROVIDER.incrementAndGet()
 
final HashSet< String > systemColumnNames
 

Static Private Attributes

static final AtomicLong VERSION_PROVIDER = new AtomicLong()
 

Detailed Description

Definition at line 45 of file HeavyDBTable.java.

Constructor & Destructor Documentation

com.mapd.calcite.parser.HeavyDBTable.HeavyDBTable ( TTableDetails  ri)
inline

Definition at line 57 of file HeavyDBTable.java.

References com.mapd.calcite.parser.HeavyDBTable.rowInfo, and com.mapd.calcite.parser.HeavyDBTable.systemColumnNames.

57  {
58  rowInfo = ri;
59  systemColumnNames = rowInfo.row_desc.stream()
60  .filter(row_desc -> row_desc.is_system)
61  .map(row_desc -> row_desc.col_name)
62  .collect(Collectors.toCollection(HashSet::new));
63  }
final HashSet< String > systemColumnNames

Member Function Documentation

RelDataType com.mapd.calcite.parser.HeavyDBTable.createType ( TColumnType  value,
RelDataTypeFactory  typeFactory 
)
inlineprivate

Definition at line 89 of file HeavyDBTable.java.

References com.mapd.calcite.parser.HeavyDBTable.getRelDataType().

Referenced by com.mapd.calcite.parser.HeavyDBTable.getRowType().

89  {
90  RelDataType cType = getRelDataType(value.col_type.type,
91  value.col_type.precision,
92  value.col_type.scale,
93  typeFactory);
94 
95  if (value.col_type.is_array) {
96  cType = typeFactory.createArrayType(
97  typeFactory.createTypeWithNullability(cType, true), -1);
98  }
99 
100  if (value.col_type.isNullable()) {
101  return typeFactory.createTypeWithNullability(cType, true);
102  } else {
103  return cType;
104  }
105  }
RelDataType getRelDataType(TDatumType dType, int precision, int scale, RelDataTypeFactory typeFactory)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Schema.TableType com.mapd.calcite.parser.HeavyDBTable.getJdbcTableType ( )
inline

Definition at line 85 of file HeavyDBTable.java.

85  {
86  return Schema.TableType.TABLE;
87  }
RelDataType com.mapd.calcite.parser.HeavyDBTable.getRelDataType ( TDatumType  dType,
int  precision,
int  scale,
RelDataTypeFactory  typeFactory 
)
inlineprivate

Definition at line 110 of file HeavyDBTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBTable.createType().

111  {
112  switch (dType) {
113  case TINYINT:
114  return typeFactory.createSqlType(SqlTypeName.TINYINT);
115  case SMALLINT:
116  return typeFactory.createSqlType(SqlTypeName.SMALLINT);
117  case INT:
118  return typeFactory.createSqlType(SqlTypeName.INTEGER);
119  case BIGINT:
120  return typeFactory.createSqlType(SqlTypeName.BIGINT);
121  case FLOAT:
122  return typeFactory.createSqlType(SqlTypeName.FLOAT);
123  case DECIMAL:
124  return typeFactory.createSqlType(SqlTypeName.DECIMAL, precision, scale);
125  case DOUBLE:
126  return typeFactory.createSqlType(SqlTypeName.DOUBLE);
127  case STR:
128  return typeFactory.createSqlType(SqlTypeName.VARCHAR, 50);
129  case TIME:
130  return typeFactory.createSqlType(SqlTypeName.TIME);
131  case TIMESTAMP:
132  return typeFactory.createSqlType(SqlTypeName.TIMESTAMP, precision);
133  case DATE:
134  return typeFactory.createSqlType(SqlTypeName.DATE);
135  case BOOL:
136  return typeFactory.createSqlType(SqlTypeName.BOOLEAN);
137  case INTERVAL_DAY_TIME:
138  return typeFactory.createSqlType(SqlTypeName.INTERVAL_DAY);
139  case INTERVAL_YEAR_MONTH:
140  return typeFactory.createSqlType(SqlTypeName.INTERVAL_YEAR_MONTH);
141  case POINT:
142  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
143  // return new PointSqlType();
144  case MULTIPOINT:
145  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
146  // return new MultipointSqlType();
147  case LINESTRING:
148  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
149  // return new LinestringSqlType();
150  case MULTILINESTRING:
151  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
152  // return new MultilinestringSqlType();
153  case POLYGON:
154  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
155  // return new PolygonSqlType();
156  case MULTIPOLYGON:
157  return typeFactory.createSqlType(SqlTypeName.GEOMETRY);
158  // return new MultipolygonSqlType();
159  default:
160  throw new AssertionError(dType.name());
161  }
162  }

+ Here is the caller graph for this function:

RelDataType com.mapd.calcite.parser.HeavyDBTable.getRowType ( RelDataTypeFactory  rdtf)
inline

Definition at line 66 of file HeavyDBTable.java.

References com.mapd.calcite.parser.HeavyDBTable.createType(), anonymous_namespace{DBETypes.cpp}.getFieldValue(), and com.mapd.calcite.parser.HeavyDBTable.rowInfo.

66  {
67  RelDataTypeFactory.Builder builder = rdtf.builder();
68  for (TColumnType tct : rowInfo.getRow_desc()) {
69  HEAVYDBLOGGER.debug("'" + tct.col_name + "'"
70  + " \t" + tct.getCol_type().getEncoding() + " \t"
71  + tct.getCol_type().getFieldValue(TTypeInfo._Fields.TYPE) + " \t"
72  + tct.getCol_type().nullable + " \t" + tct.getCol_type().is_array + " \t"
73  + tct.getCol_type().precision + " \t" + tct.getCol_type().scale);
74  builder.add(tct.col_name, createType(tct, rdtf));
75  }
76  return builder.build();
77  }
RelDataType createType(TColumnType value, RelDataTypeFactory typeFactory)
void getFieldValue(T &result, TargetValue *field)
Definition: DBETypes.cpp:28

+ Here is the call graph for this function:

Statistic com.mapd.calcite.parser.HeavyDBTable.getStatistic ( )
inline

Definition at line 80 of file HeavyDBTable.java.

80  {
81  return Statistics.UNKNOWN;
82  }
long com.mapd.calcite.parser.HeavyDBTable.getVersion ( )
inline

Definition at line 53 of file HeavyDBTable.java.

References com.mapd.calcite.parser.HeavyDBTable.version.

53  {
54  return version;
55  }
boolean com.mapd.calcite.parser.HeavyDBTable.isRolledUp ( String  string)
inline

Definition at line 165 of file HeavyDBTable.java.

165  {
166  // will set to false by default
167  return false;
168  }
boolean com.mapd.calcite.parser.HeavyDBTable.isSystemColumn ( final String  columnName)
inline

Definition at line 177 of file HeavyDBTable.java.

177  {
178  return systemColumnNames.contains(columnName);
179  }
boolean com.mapd.calcite.parser.HeavyDBTable.rolledUpColumnValidInsideAgg ( String  string,
SqlCall  sc,
SqlNode  sn,
CalciteConnectionConfig  ccc 
)
inline

Definition at line 171 of file HeavyDBTable.java.

172  {
173  throw new UnsupportedOperationException(
174  "rolledUpColumnValidInsideAgg Not supported yet.");
175  }

Member Data Documentation

final Logger com.mapd.calcite.parser.HeavyDBTable.HEAVYDBLOGGER = LoggerFactory.getLogger(HeavyDBTable.class)
staticpackage

Definition at line 48 of file HeavyDBTable.java.

final TTableDetails com.mapd.calcite.parser.HeavyDBTable.rowInfo
private
final HashSet<String> com.mapd.calcite.parser.HeavyDBTable.systemColumnNames
private

Definition at line 51 of file HeavyDBTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBTable.HeavyDBTable().

final long com.mapd.calcite.parser.HeavyDBTable.version = VERSION_PROVIDER.incrementAndGet()
private
final AtomicLong com.mapd.calcite.parser.HeavyDBTable.VERSION_PROVIDER = new AtomicLong()
staticprivate

Definition at line 46 of file HeavyDBTable.java.


The documentation for this class was generated from the following file: