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

Public Member Functions

long getVersion ()
 
 MapDTable (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)
 

Static Package Attributes

static final Logger MAPDLOGGER = LoggerFactory.getLogger(MapDTable.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()
 

Static Private Attributes

static final AtomicLong VERSION_PROVIDER = new AtomicLong()
 

Detailed Description

Author
michael

Definition at line 35 of file MapDTable.java.

Constructor & Destructor Documentation

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

Definition at line 46 of file MapDTable.java.

References com.mapd.calcite.parser.MapDTable.rowInfo.

46  {
47  rowInfo = ri;
48  }
final TTableDetails rowInfo
Definition: MapDTable.java:39

Member Function Documentation

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

Definition at line 74 of file MapDTable.java.

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

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

74  {
75  RelDataType cType = getRelDataType(value.col_type.type,
76  value.col_type.precision,
77  value.col_type.scale,
78  typeFactory);
79 
80  if (value.col_type.is_array) {
81  cType = typeFactory.createArrayType(
82  typeFactory.createTypeWithNullability(cType, true), -1);
83  }
84 
85  if (value.col_type.isNullable()) {
86  return typeFactory.createTypeWithNullability(cType, true);
87  } else {
88  return cType;
89  }
90  }
RelDataType getRelDataType(TDatumType dType, int precision, int scale, RelDataTypeFactory typeFactory)
Definition: MapDTable.java:95

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 70 of file MapDTable.java.

70  {
71  return Schema.TableType.TABLE;
72  }
RelDataType com.mapd.calcite.parser.MapDTable.getRelDataType ( TDatumType  dType,
int  precision,
int  scale,
RelDataTypeFactory  typeFactory 
)
inlineprivate

Definition at line 95 of file MapDTable.java.

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

96  {
97  switch (dType) {
98  case TINYINT:
99  return typeFactory.createSqlType(SqlTypeName.TINYINT);
100  case SMALLINT:
101  return typeFactory.createSqlType(SqlTypeName.SMALLINT);
102  case INT:
103  return typeFactory.createSqlType(SqlTypeName.INTEGER);
104  case BIGINT:
105  return typeFactory.createSqlType(SqlTypeName.BIGINT);
106  case FLOAT:
107  return typeFactory.createSqlType(SqlTypeName.FLOAT);
108  case DECIMAL:
109  return typeFactory.createSqlType(SqlTypeName.DECIMAL, precision, scale);
110  case DOUBLE:
111  return typeFactory.createSqlType(SqlTypeName.DOUBLE);
112  case STR:
113  return typeFactory.createSqlType(SqlTypeName.VARCHAR, 50);
114  case TIME:
115  return typeFactory.createSqlType(SqlTypeName.TIME);
116  case TIMESTAMP:
117  return typeFactory.createSqlType(SqlTypeName.TIMESTAMP, precision);
118  case DATE:
119  return typeFactory.createSqlType(SqlTypeName.DATE);
120  case BOOL:
121  return typeFactory.createSqlType(SqlTypeName.BOOLEAN);
122  case INTERVAL_DAY_TIME:
123  return typeFactory.createSqlType(SqlTypeName.INTERVAL_DAY);
124  case INTERVAL_YEAR_MONTH:
125  return typeFactory.createSqlType(SqlTypeName.INTERVAL_YEAR_MONTH);
126  case POINT:
127  return typeFactory.createSqlType(SqlTypeName.ANY);
128  // return new PointSqlType();
129  case LINESTRING:
130  return typeFactory.createSqlType(SqlTypeName.ANY);
131  // return new LinestringSqlType();
132  case POLYGON:
133  return typeFactory.createSqlType(SqlTypeName.ANY);
134  // return new PolygonSqlType();
135  case MULTIPOLYGON:
136  return typeFactory.createSqlType(SqlTypeName.ANY);
137  default:
138  throw new AssertionError(dType.name());
139  }
140  }

+ Here is the caller graph for this function:

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

Definition at line 51 of file MapDTable.java.

References com.mapd.calcite.parser.MapDTable.createType(), and com.mapd.calcite.parser.MapDTable.rowInfo.

51  {
52  RelDataTypeFactory.FieldInfoBuilder builder = rdtf.builder();
53  for (TColumnType tct : rowInfo.getRow_desc()) {
54  MAPDLOGGER.debug("'" + tct.col_name + "'"
55  + " \t" + tct.getCol_type().getEncoding() + " \t"
56  + tct.getCol_type().getFieldValue(TTypeInfo._Fields.TYPE) + " \t"
57  + tct.getCol_type().nullable + " \t" + tct.getCol_type().is_array + " \t"
58  + tct.getCol_type().precision + " \t" + tct.getCol_type().scale);
59  builder.add(tct.col_name, createType(tct, rdtf));
60  }
61  return builder.build();
62  }
RelDataType createType(TColumnType value, RelDataTypeFactory typeFactory)
Definition: MapDTable.java:74
final TTableDetails rowInfo
Definition: MapDTable.java:39

+ Here is the call graph for this function:

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

Definition at line 65 of file MapDTable.java.

65  {
66  return Statistics.UNKNOWN;
67  }
long com.mapd.calcite.parser.MapDTable.getVersion ( )
inline

Definition at line 42 of file MapDTable.java.

References com.mapd.calcite.parser.MapDTable.version.

42  {
43  return version;
44  }
boolean com.mapd.calcite.parser.MapDTable.isRolledUp ( String  string)
inline

Definition at line 143 of file MapDTable.java.

143  {
144  // will set to false by default
145  return false;
146  }
boolean com.mapd.calcite.parser.MapDTable.rolledUpColumnValidInsideAgg ( String  string,
SqlCall  sc,
SqlNode  sn,
CalciteConnectionConfig  ccc 
)
inline

Definition at line 149 of file MapDTable.java.

150  {
151  throw new UnsupportedOperationException(
152  "rolledUpColumnValidInsideAgg Not supported yet.");
153  }

Member Data Documentation

final Logger com.mapd.calcite.parser.MapDTable.MAPDLOGGER = LoggerFactory.getLogger(MapDTable.class)
staticpackage

Definition at line 38 of file MapDTable.java.

final TTableDetails com.mapd.calcite.parser.MapDTable.rowInfo
private
final long com.mapd.calcite.parser.MapDTable.version = VERSION_PROVIDER.incrementAndGet()
private

Definition at line 40 of file MapDTable.java.

Referenced by com.mapd.calcite.parser.MapDTable.getVersion().

final AtomicLong com.mapd.calcite.parser.MapDTable.VERSION_PROVIDER = new AtomicLong()
staticprivate

Definition at line 36 of file MapDTable.java.


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