OmniSciDB  a7179b2938
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OmniSciTypeNameSpec.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl.omnisci;
2 
3 import static java.util.Objects.requireNonNull;
4 
5 import org.apache.calcite.sql.SqlBasicTypeNameSpec;
6 import org.apache.calcite.sql.SqlDataTypeSpec;
7 import org.apache.calcite.sql.SqlTypeNameSpec;
8 import org.apache.calcite.sql.parser.SqlParserPos;
9 import org.apache.calcite.sql.type.SqlTypeName;
10 import org.apache.calcite.util.Pair;
11 
12 import java.util.TimeZone;
13 
14 public class OmniSciTypeNameSpec extends SqlBasicTypeNameSpec {
15  private boolean isText;
16 
17  private Integer arraySize = -1;
18  private boolean isArray = false;
19 
20  // array type constructor
22  SqlTypeName typeName, boolean isText, Integer size, SqlParserPos pos) {
23  this(typeName, isText, size, -1, -1, pos);
24  }
25 
26  // decimal array type constructor
27  public OmniSciTypeNameSpec(SqlTypeName typeName,
28  boolean isText,
29  Integer size,
30  Integer precision,
31  Integer scale,
32  SqlParserPos pos) {
33  super(typeName, precision, scale, pos);
34  this.isText = isText;
35  this.isArray = true;
36  this.arraySize = size;
37  }
38 
39  // standalone text type constructor
40  public OmniSciTypeNameSpec(SqlTypeName typeName, boolean isText, SqlParserPos pos) {
41  super(typeName, pos);
42  this.isText = isText;
43  }
44 
45  public boolean getIsText() {
46  return isText;
47  }
48 
49  public boolean getIsArray() {
50  return isArray;
51  }
52 
53  public Integer getArraySize() {
54  return arraySize;
55  }
56 }
OmniSciTypeNameSpec(SqlTypeName typeName, boolean isText, Integer size, SqlParserPos pos)
OmniSciTypeNameSpec(SqlTypeName typeName, boolean isText, SqlParserPos pos)
OmniSciTypeNameSpec(SqlTypeName typeName, boolean isText, Integer size, Integer precision, Integer scale, SqlParserPos pos)