private StateField(String name, Class<?> type, Object initialValue, String getterName, Optional<Type> sqlType) { this.name = requireNonNull(name, "name is null"); checkArgument(!name.isEmpty(), "name is empty"); this.type = requireNonNull(type, "type is null"); this.getterName = requireNonNull(getterName, "getterName is null"); this.initialValue = initialValue; checkArgument(sqlType != null, "sqlType is null"); if (sqlType.isPresent()) { checkArgument( (sqlType.get().getJavaType() == type) || ((type == byte.class) && TINYINT.equals(sqlType.get())) || ((type == int.class) && INTEGER.equals(sqlType.get())), "Stack type (%s) and provided sql type (%s) are incompatible", type.getName(), sqlType.get().getDisplayName()); } else { sqlType = sqlTypeFromStackType(type); } this.sqlType = sqlType; }
private StateField(String name, Class<?> type, Object initialValue, String getterName, Optional<Type> sqlType) { this.name = requireNonNull(name, "name is null"); checkArgument(!name.isEmpty(), "name is empty"); this.type = requireNonNull(type, "type is null"); this.getterName = requireNonNull(getterName, "getterName is null"); this.initialValue = initialValue; checkArgument(sqlType != null, "sqlType is null"); if (sqlType.isPresent()) { checkArgument( (sqlType.get().getJavaType() == type) || ((type == byte.class) && TINYINT.equals(sqlType.get())) || ((type == int.class) && INTEGER.equals(sqlType.get())), "Stack type (%s) and provided sql type (%s) are incompatible", type.getName(), sqlType.get().getDisplayName()); } else { sqlType = sqlTypeFromStackType(type); } this.sqlType = sqlType; }
private static boolean convertibleToDoubleWithCast(Type type) { return type instanceof DecimalType || DoubleType.DOUBLE.equals(type) || RealType.REAL.equals(type) || BigintType.BIGINT.equals(type) || IntegerType.INTEGER.equals(type) || SmallintType.SMALLINT.equals(type) || TinyintType.TINYINT.equals(type) || BooleanType.BOOLEAN.equals(type); } }
private static boolean convertibleToDoubleWithCast(Type type) { return type instanceof DecimalType || DoubleType.DOUBLE.equals(type) || RealType.REAL.equals(type) || BigintType.BIGINT.equals(type) || IntegerType.INTEGER.equals(type) || SmallintType.SMALLINT.equals(type) || TinyintType.TINYINT.equals(type) || BooleanType.BOOLEAN.equals(type); } }
return value; else if (TINYINT.equals(type)) { return ((Number) value).byteValue();
statement.setShort(parameter, Shorts.checkedCast(type.getLong(block, position))); else if (TINYINT.equals(type)) { statement.setByte(parameter, SignedBytes.checkedCast(type.getLong(block, position)));
statement.setShort(parameter, Shorts.checkedCast(type.getLong(block, position))); else if (TINYINT.equals(type)) { statement.setByte(parameter, SignedBytes.checkedCast(type.getLong(block, position)));
return ImmutableList.of(new OrcType(OrcTypeKind.BOOLEAN)); if (TINYINT.equals(type)) { return ImmutableList.of(new OrcType(OrcTypeKind.BYTE));
return ImmutableList.of(new OrcType(OrcTypeKind.BOOLEAN)); if (TINYINT.equals(type)) { return ImmutableList.of(new OrcType(OrcTypeKind.BYTE));
return new BooleanOrcPredicate(expectedValues, format == DWRF); if (TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type)) { return new LongOrcPredicate( expectedValues.stream()
private static boolean isValidPartitionType(Type type) { return type instanceof DecimalType || BOOLEAN.equals(type) || TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type) || REAL.equals(type) || DOUBLE.equals(type) || DATE.equals(type) || TIMESTAMP.equals(type) || isVarcharType(type) || isCharType(type); }
return (short) type.getLong(block, position); if (TinyintType.TINYINT.equals(type)) { return (byte) type.getLong(block, position);
return new BooleanOrcPredicate(expectedValues, format == DWRF); if (TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type)) { return new LongOrcPredicate( expectedValues.stream()
return booleanEncoding(type); if (TINYINT.equals(type)) { return byteEncoding(type);
row.addShort(destChannel, (short) type.getLong(block, position)); else if (TINYINT.equals(type)) { row.addByte(destChannel, (byte) type.getLong(block, position));
parseLongColumn(column); else if (TINYINT.equals(type)) { parseLongColumn(column);
return cursor.getBoolean(field); else if (TINYINT.equals(type)) { return cursor.getLong(field);
return cursor.getBoolean(field); else if (TINYINT.equals(type)) { return cursor.getLong(field);
assertInstanceOf(value, Boolean.class); else if (TINYINT.equals(column.getType())) { assertInstanceOf(value, Byte.class);
assertInstanceOf(value, Boolean.class); else if (TINYINT.equals(column.getType())) { assertInstanceOf(value, Byte.class);