@Override public int getMaxScale(final SqlTypeName typeName) { return RelDataTypeSystem.DEFAULT.getMaxScale(typeName); }
final int minPrecision = qualifier.typeName().getMinPrecision(); final int minScale = qualifier.typeName().getMinScale(); final int maxScale = typeSystem.getMaxScale(qualifier.typeName()); if (qualifier.isYearMonth()) { if (startPrecision < minPrecision || startPrecision > maxPrecision) {
public int getMaxScale(SqlTypeName typeName) { return typeSystem.getMaxScale(typeName); }
@Override public int getMaxScale(final SqlTypeName typeName) { return RelDataTypeSystem.DEFAULT.getMaxScale(typeName); }
public int getMaxScale(SqlTypeName typeName) { return typeSystem.getMaxScale(typeName); }
private ImmutableList<MetaTypeInfo> getAllDefaultType() { final ImmutableList.Builder<MetaTypeInfo> allTypeList = ImmutableList.builder(); final CalciteConnectionImpl conn = (CalciteConnectionImpl) connection; final RelDataTypeSystem typeSystem = conn.typeFactory.getTypeSystem(); for (SqlTypeName sqlTypeName : SqlTypeName.values()) { allTypeList.add( new MetaTypeInfo(sqlTypeName.getName(), sqlTypeName.getJdbcOrdinal(), typeSystem.getMaxPrecision(sqlTypeName), typeSystem.getLiteral(sqlTypeName, true), typeSystem.getLiteral(sqlTypeName, false), // All types are nullable (short) DatabaseMetaData.typeNullable, typeSystem.isCaseSensitive(sqlTypeName), // Making all type searchable; we may want to // be specific and declare under SqlTypeName (short) DatabaseMetaData.typeSearchable, false, false, typeSystem.isAutoincrement(sqlTypeName), (short) sqlTypeName.getMinScale(), (short) typeSystem.getMaxScale(sqlTypeName), typeSystem.getNumTypeRadix(sqlTypeName))); } return allTypeList.build(); }
private ImmutableList<MetaTypeInfo> getAllDefaultType() { final ImmutableList.Builder<MetaTypeInfo> allTypeList = ImmutableList.builder(); final CalciteConnectionImpl conn = (CalciteConnectionImpl) connection; final RelDataTypeSystem typeSystem = conn.typeFactory.getTypeSystem(); for (SqlTypeName sqlTypeName : SqlTypeName.values()) { allTypeList.add( new MetaTypeInfo(sqlTypeName.getName(), sqlTypeName.getJdbcOrdinal(), typeSystem.getMaxPrecision(sqlTypeName), typeSystem.getLiteral(sqlTypeName, true), typeSystem.getLiteral(sqlTypeName, false), // All types are nullable (short) DatabaseMetaData.typeNullable, typeSystem.isCaseSensitive(sqlTypeName), // Making all type searchable; we may want to // be specific and declare under SqlTypeName (short) DatabaseMetaData.typeSearchable, false, false, typeSystem.isAutoincrement(sqlTypeName), (short) sqlTypeName.getMinScale(), (short) typeSystem.getMaxScale(sqlTypeName), typeSystem.getNumTypeRadix(sqlTypeName))); } return allTypeList.build(); }
private ImmutableList<MetaTypeInfo> getAllDefaultType() { final ImmutableList.Builder<MetaTypeInfo> allTypeList = new ImmutableList.Builder<>(); final RelDataTypeSystem typeSystem = getConnection().getTypeFactory().getTypeSystem(); for (SqlTypeName sqlTypeName : SqlTypeName.values()) { allTypeList.add( new MetaTypeInfo(sqlTypeName.getName(), sqlTypeName.getJdbcOrdinal(), typeSystem.getMaxPrecision(sqlTypeName), typeSystem.getLiteral(sqlTypeName, true), typeSystem.getLiteral(sqlTypeName, false), // All types are nullable (short) DatabaseMetaData.typeNullable, typeSystem.isCaseSensitive(sqlTypeName), // Making all type searchable; we may want to // be specific and declare under SqlTypeName (short) DatabaseMetaData.typeSearchable, false, false, typeSystem.isAutoincrement(sqlTypeName), (short) sqlTypeName.getMinScale(), (short) typeSystem.getMaxScale(sqlTypeName), typeSystem.getNumTypeRadix(sqlTypeName))); } return allTypeList.build(); }
final int minPrecision = qualifier.typeName().getMinPrecision(); final int minScale = qualifier.typeName().getMinScale(); final int maxScale = typeSystem.getMaxScale(qualifier.typeName()); if (qualifier.isYearMonth()) { if (startPrecision < minPrecision || startPrecision > maxPrecision) {
final int minPrecision = qualifier.typeName().getMinPrecision(); final int minScale = qualifier.typeName().getMinScale(); final int maxScale = typeSystem.getMaxScale(qualifier.typeName()); if (qualifier.isYearMonth()) { if (startPrecision < minPrecision || startPrecision > maxPrecision) {
assertThat(typeSystem.getDefaultPrecision(typeName), is(2)); assertThat(typeName.getMinScale(), is(1)); assertThat(typeSystem.getMaxScale(typeName), is(9)); assertThat(typeName.getDefaultScale(), is(6));
assertThat(typeSystem.getDefaultPrecision(typeName), is(2)); assertThat(typeName.getMinScale(), is(1)); assertThat(typeSystem.getMaxScale(typeName), is(9)); assertThat(typeName.getDefaultScale(), is(6));