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; } }
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; } }
public RelDataType createSqlType( SqlTypeName typeName, int precision) { final int maxPrecision = typeSystem.getMaxPrecision(typeName); if (maxPrecision >= 0 && precision > maxPrecision) { precision = maxPrecision; } if (typeName.allowsScale()) { return createSqlType(typeName, precision, typeName.getDefaultScale()); } assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeSystem, typeName, precision); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }
public RelDataType createSqlType( SqlTypeName typeName, int precision) { final int maxPrecision = typeSystem.getMaxPrecision(typeName); if (maxPrecision >= 0 && precision > maxPrecision) { precision = maxPrecision; } if (typeName.allowsScale()) { return createSqlType(typeName, precision, typeName.getDefaultScale()); } assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeSystem, typeName, precision); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }
boolean beyond) { int precision = typeName.allowsPrec() ? this.getPrecision() : -1; int scale = typeName.allowsScale() ? this.getScale() : -1; return typeName.getLimit( sign,
boolean beyond) { int precision = typeName.allowsPrec() ? this.getPrecision() : -1; int scale = typeName.allowsScale() ? this.getScale() : -1; return typeName.getLimit( sign,
writer.startList(SqlWriter.FrameTypeEnum.FUN_CALL, "(", ")"); writer.print(precision); if (sqlTypeName.allowsScale() && (scale >= 0)) { writer.sep(",", true); writer.print(scale);
writer.startList(SqlWriter.FrameTypeEnum.FUN_CALL, "(", ")"); writer.print(precision); if (sqlTypeName.allowsScale() && (scale >= 0)) { writer.sep(",", true); writer.print(scale);
if (typeName.allowsScale()) { return new SqlDataTypeSpec( typeIdentifier,
if (typeName.allowsScale()) { return new SqlDataTypeSpec( typeIdentifier,
if (typeName.allowsScale()) { return new SqlDataTypeSpec( typeIdentifier,
precision = -1; if (!type.getSqlTypeName().allowsScale()) { scale = -1;
precision = -1; if (!type.getSqlTypeName().allowsScale()) { scale = -1;
field.getType().getFullTypeString(), precision, field.getType().getSqlTypeName().allowsScale() ? field.getType().getScale() : null,
field.getType().getFullTypeString(), precision, field.getType().getSqlTypeName().allowsScale() ? field.getType().getScale() : null,