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); } }
return value; else if (TINYINT.equals(type)) { return ((Number) value).byteValue();
fieldBuilders = ImmutableList.of(); else if (TINYINT.equals(type)) { statisticsBuilder = new CountStatisticsBuilder(); fieldExtractor = ignored -> ImmutableList.of();
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));
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 new BooleanOrcPredicate(expectedValues, format == DWRF); if (TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type)) { return new LongOrcPredicate( expectedValues.stream()
return (short) type.getLong(block, position); if (TinyintType.TINYINT.equals(type)) { return (byte) type.getLong(block, position);
return HIVE_SHORT.getTypeInfo(); if (TINYINT.equals(type)) { return HIVE_BYTE.getTypeInfo();
return booleanEncoding(type); if (TINYINT.equals(type)) { return byteEncoding(type);
booleans[columnIndex] = booleanPartitionKey(columnValue, name); else if (TINYINT.equals(type)) { longs[columnIndex] = tinyintPartitionKey(columnValue, name);
type.writeLong(blockBuilder, ((Number) value).shortValue()); else if (TINYINT.equals(type)) { type.writeLong(blockBuilder, ((Number) value).byteValue());
row.addShort(destChannel, (short) type.getLong(block, position)); else if (TINYINT.equals(type)) { row.addByte(destChannel, (byte) type.getLong(block, position));
if (TINYINT.equals(type)) { if (isNull) { return NullableValue.asNull(TINYINT);
type.writeBoolean(blockBuilder, (Boolean) value); else if (TINYINT.equals(type)) { type.writeLong(blockBuilder, ((Number) value).longValue());
type.writeBoolean(blockBuilder, (Boolean) value); else if (TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type)) { type.writeLong(blockBuilder, ((Number) value).longValue());
parseLongColumn(column); else if (TINYINT.equals(type)) { parseLongColumn(column);
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);