public SqlIdentifier getSqlIdentifier() { SqlTypeName typeName = getSqlTypeName(); if (typeName == null) { return null; } return new SqlIdentifier( typeName.name(), SqlParserPos.ZERO); }
public SqlIdentifier getSqlIdentifier() { SqlTypeName typeName = getSqlTypeName(); if (typeName == null) { return null; } return new SqlIdentifier( typeName.name(), SqlParserPos.ZERO); }
/** * Constructs a type with no parameters. This should only be called from a * factory method. * * @param typeName Type name */ public BasicSqlType(SqlTypeName typeName) { super(typeName, false, null); assert typeName.allowsPrecScale(false, false) : "typeName.allowsPrecScale(false,false), typeName=" + typeName.name(); this.precision = PRECISION_NOT_SPECIFIED; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
final public SqlIdentifier CollectionsTypeName() throws ParseException { SqlIdentifier typeName = null; SqlParserPos pos = getPos(); jj_consume_token(MULTISET); typeName = new SqlIdentifier( SqlTypeName.MULTISET.name(),pos); {if (true) return typeName;} throw new Error("Missing return statement in function"); }
final public SqlIdentifier CollectionsTypeName() throws ParseException { SqlIdentifier typeName = null; SqlParserPos pos = getPos(); jj_consume_token(MULTISET); typeName = new SqlIdentifier( SqlTypeName.MULTISET.name(),pos); {if (true) return typeName;} throw new Error("Missing return statement in function"); }
sb.append(typeName.name()); boolean printPrecision = (precision != PRECISION_NOT_SPECIFIED); boolean printScale = (scale != SCALE_NOT_SPECIFIED);
sb.append(typeName.name()); boolean printPrecision = precision != PRECISION_NOT_SPECIFIED; boolean printScale = scale != SCALE_NOT_SPECIFIED;
/** * Constructs a type with no parameters. This should only be called from a * factory method. * * @param typeName Type name * * @pre typeName.allowsNoPrecNoScale(false,false) */ public BasicSqlType(SqlTypeName typeName) { super(typeName, false, null); Util.pre( typeName.allowsPrecScale(false, false), "typeName.allowsPrecScale(false,false), typeName=" + typeName.name()); this.precision = PRECISION_NOT_SPECIFIED; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
private Object toJson(RelDataType node) { if (node.isStruct()) { final List<Object> list = jsonBuilder.list(); for (RelDataTypeField field : node.getFieldList()) { list.add(toJson(field)); } return list; } else { final Map<String, Object> map = jsonBuilder.map(); map.put("type", node.getSqlTypeName().name()); map.put("nullable", node.isNullable()); if (node.getSqlTypeName().allowsPrec()) { map.put("precision", node.getPrecision()); } if (node.getSqlTypeName().allowsScale()) { map.put("scale", node.getScale()); } return map; } }
map.put("type", literal.getTypeName().name()); return map;
SqlTypeName.CHAR.name(), pos); if (jj_2_284(2)) { jj_consume_token(VARYING); typeName = new SqlIdentifier( SqlTypeName.VARCHAR.name(), pos); } else { jj_consume_token(VARCHAR); typeName = new SqlIdentifier( SqlTypeName.VARCHAR.name(), pos); } else if (jj_2_292(2)) { jj_consume_token(DATE); typeName = new SqlIdentifier( SqlTypeName.DATE.name(),pos); } else if (jj_2_293(2)) { jj_consume_token(TIME); typeName = new SqlIdentifier( SqlTypeName.TIME.name(),pos); } else if (jj_2_294(2)) { jj_consume_token(TIMESTAMP); typeName = new SqlIdentifier( SqlTypeName.TIMESTAMP.name(),pos); } else if (jj_2_295(2)) { if (jj_2_285(2)) { SqlTypeName.DECIMAL.name(),pos); } else if (jj_2_296(2)) { jj_consume_token(BOOLEAN); typeName = new SqlIdentifier(
SqlTypeName.CHAR.name(), pos); if (jj_2_273(2)) { jj_consume_token(VARYING); typeName = new SqlIdentifier( SqlTypeName.VARCHAR.name(), pos); } else { jj_consume_token(VARCHAR); typeName = new SqlIdentifier( SqlTypeName.VARCHAR.name(), pos); } else if (jj_2_281(2)) { jj_consume_token(DATE); typeName = new SqlIdentifier( SqlTypeName.DATE.name(),pos); } else if (jj_2_282(2)) { jj_consume_token(TIME); typeName = new SqlIdentifier( SqlTypeName.TIME.name(),pos); } else if (jj_2_283(2)) { jj_consume_token(TIMESTAMP); typeName = new SqlIdentifier( SqlTypeName.TIMESTAMP.name(),pos); } else if (jj_2_284(2)) { if (jj_2_274(2)) { SqlTypeName.DECIMAL.name(),pos); } else if (jj_2_285(2)) { jj_consume_token(BOOLEAN); typeName = new SqlIdentifier(
SqlIdentifier typeIdentifier = new SqlIdentifier( typeName.name(), SqlParserPos.ZERO);
private SqlNode toSql(RelDataType type) { if (dialect.getDatabaseProduct() == SqlDialect.DatabaseProduct.MYSQL) { final SqlTypeName sqlTypeName = type.getSqlTypeName(); switch (sqlTypeName) { case VARCHAR: // MySQL doesn't have a VARCHAR type, only CHAR. return new SqlDataTypeSpec(new SqlIdentifier("CHAR", POS), type.getPrecision(), -1, null, null, POS); case INTEGER: return new SqlDataTypeSpec(new SqlIdentifier("_UNSIGNED", POS), type.getPrecision(), -1, null, null, POS); } } if (type instanceof BasicSqlType) { return new SqlDataTypeSpec( new SqlIdentifier(type.getSqlTypeName().name(), POS), type.getPrecision(), type.getScale(), type.getCharset() != null && dialect.supportsCharSet() ? type.getCharset().name() : null, null, POS); } throw new AssertionError(type); // TODO: implement }
private SqlNode toSql(RelDataType type) { switch (dialect.getDatabaseProduct()) { case MYSQL: switch (type.getSqlTypeName()) { case VARCHAR: // MySQL doesn't have a VARCHAR type, only CHAR. return new SqlDataTypeSpec(new SqlIdentifier("CHAR", POS), type.getPrecision(), -1, null, null, POS); case INTEGER: return new SqlDataTypeSpec(new SqlIdentifier("_UNSIGNED", POS), type.getPrecision(), -1, null, null, POS); } break; } if (type instanceof BasicSqlType) { return new SqlDataTypeSpec( new SqlIdentifier(type.getSqlTypeName().name(), POS), type.getPrecision(), type.getScale(), type.getCharset() != null && dialect.supportsCharSet() ? type.getCharset().name() : null, null, POS); } throw new AssertionError(type); // TODO: implement }
SqlIdentifier typeIdentifier = new SqlIdentifier( typeName.name(), SqlParserPos.ZERO);