public static int sqlArrayType(String sqlTypeName) { PDataType fromSqlTypeName = fromSqlTypeName(sqlTypeName); return fromSqlTypeName.getSqlType() + PDataType.ARRAY_TYPE_BASE; }
CastParseNode(ParseNode expr, String dataType, Integer maxLength, Integer scale, boolean arr) { this(expr, PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType)), maxLength, scale, arr); }
@Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { checkOpen(); PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PArrayDataType.instantiatePhoenixArray(arrayPrimitiveType, elements); }
dataType = PDataType.fromSqlTypeName(typeParts[0]); dataType = PDataType.fromSqlTypeName(typeParts[0] + " " + typeParts[1]);
PDataType.fromSqlTypeName(sqlTypeName).getSqlType()); fullColumnNameToTypeMap.put( fullColumn, PDataType.fromSqlTypeName(sqlTypeName).getSqlType());
public LiteralParseNode literal(String value, String sqlTypeName) throws SQLException { PDataType expectedType = sqlTypeName == null ? null : PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(sqlTypeName)); if (expectedType == null || !expectedType.isCoercibleTo(PTimestamp.INSTANCE)) { throw TypeMismatchException.newException(expectedType, PTimestamp.INSTANCE); } Object typedValue = expectedType.toObject(value); return new LiteralParseNode(typedValue); }
@Test public void testFromSqlTypeName() { assertEquals(PVarchar.INSTANCE, PDataType.fromSqlTypeName("varchar")); }
@SuppressWarnings({ "unchecked", "rawtypes" }) BuiltInFunctionArgInfo(FunctionArgument arg) { PDataType dataType = arg.isArrayType() ? PDataType.fromTypeId(PDataType.sqlArrayType(SchemaUtil .normalizeIdentifier(SchemaUtil.normalizeIdentifier(arg .getArgumentType())))) : PDataType.fromSqlTypeName(SchemaUtil .normalizeIdentifier(arg.getArgumentType())); this.allowedValues = Collections.emptySet(); this.allowedTypes = new Class[] { dataType.getClass() }; this.isConstant = arg.isConstant(); this.defaultValue = arg.getDefaultValue() == null ? null : arg.getDefaultValue(); this.minValue = arg.getMinValue() == null ? null : arg.getMinValue(); this.maxValue = arg.getMaxValue() == null ? null : arg.getMaxValue(); }
public static int sqlArrayType(String sqlTypeName) { PDataType fromSqlTypeName = fromSqlTypeName(sqlTypeName); return fromSqlTypeName.getSqlType() + PDataType.ARRAY_TYPE_BASE; }
public static int sqlArrayType(String sqlTypeName) { PDataType fromSqlTypeName = fromSqlTypeName(sqlTypeName); return fromSqlTypeName.getSqlType() + PDataType.ARRAY_TYPE_BASE; }
CastParseNode(ParseNode expr, String dataType, Integer maxLength, Integer scale, boolean arr) { this(expr, PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType)), maxLength, scale, arr); }
familyName = PNameFactory.newName(column.getFamilyNameBytes().toByteArray()); PDataType dataType = column.hasDataType() ? PDataType.fromSqlTypeName(column.getDataType()) : null; Integer maxLength = null; if (column.hasMaxLength()) {
CastParseNode(ParseNode expr, String dataType, Integer maxLength, Integer scale, boolean arr) { this(expr, PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(dataType)), maxLength, scale, arr); }
this.isArray = true; dataType = sqlTypeName == null ? null : PDataType.fromTypeId(PDataType.sqlArrayType(SchemaUtil.normalizeIdentifier(sqlTypeName))); baseType = sqlTypeName == null ? null : PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(sqlTypeName)); this.arrSize = arrSize; // Can only be non negative based on parsing if (baseType == PVarbinary.INSTANCE) { baseType = dataType = sqlTypeName == null ? null : PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(sqlTypeName)); if (this.isArray = dataType != null && dataType.isArrayType()) { baseType = PDataType.arrayBaseType(dataType);
.sqlArrayType(SchemaUtil.normalizeIdentifier(SchemaUtil .normalizeIdentifier(argType)))) : PDataType .fromSqlTypeName(SchemaUtil.normalizeIdentifier(argType)); boolean isConstant = arg.hasIsConstant()?arg.getIsConstant():false; String defaultValue = arg.hasDefaultValue()?arg.getDefaultValue():null;
@Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { checkOpen(); PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PArrayDataType.instantiatePhoenixArray(arrayPrimitiveType, elements); }
@Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { checkOpen(); PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PArrayDataType.instantiatePhoenixArray(arrayPrimitiveType, elements); }
public LiteralParseNode literal(String value, String sqlTypeName) throws SQLException { PDataType expectedType = sqlTypeName == null ? null : PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(sqlTypeName)); if (expectedType == null || !expectedType.isCoercibleTo(PTimestamp.INSTANCE)) { throw TypeMismatchException.newException(expectedType, PTimestamp.INSTANCE); } Object typedValue = expectedType.toObject(value); return new LiteralParseNode(typedValue); }
public LiteralParseNode literal(String value, String sqlTypeName) throws SQLException { PDataType expectedType = sqlTypeName == null ? null : PDataType.fromSqlTypeName(SchemaUtil.normalizeIdentifier(sqlTypeName)); if (expectedType == null || !expectedType.isCoercibleTo(PTimestamp.INSTANCE)) { throw TypeMismatchException.newException(expectedType, PTimestamp.INSTANCE); } Object typedValue = expectedType.toObject(value); return new LiteralParseNode(typedValue); }
@SuppressWarnings({ "unchecked", "rawtypes" }) BuiltInFunctionArgInfo(FunctionArgument arg) { PDataType dataType = arg.isArrayType() ? PDataType.fromTypeId(PDataType.sqlArrayType(SchemaUtil .normalizeIdentifier(SchemaUtil.normalizeIdentifier(arg .getArgumentType())))) : PDataType.fromSqlTypeName(SchemaUtil .normalizeIdentifier(arg.getArgumentType())); this.allowedValues = Collections.emptySet(); this.allowedTypes = new Class[] { dataType.getClass() }; this.isConstant = arg.isConstant(); this.defaultValue = arg.getDefaultValue() == null ? null : arg.getDefaultValue(); this.minValue = arg.getMinValue() == null ? null : arg.getMinValue(); this.maxValue = arg.getMaxValue() == null ? null : arg.getMaxValue(); }