use of io.trino.plugin.hive.HiveTypeName in project trino by trinodb.
the class AcidSchema method createAcidSchema.
public static Properties createAcidSchema(HiveType rowType) {
Properties hiveAcidSchema = new Properties();
hiveAcidSchema.setProperty(IOConstants.COLUMNS, String.join(",", ACID_COLUMN_NAMES));
// We must supply an accurate row type, because Apache ORC code we don't control has a consistency
// check that the layout of this "row" must agree with the layout of an inserted row.
hiveAcidSchema.setProperty(IOConstants.COLUMNS_TYPES, createAcidColumnHiveTypes(rowType).stream().map(HiveType::getHiveTypeName).map(HiveTypeName::toString).collect(joining(":")));
return hiveAcidSchema;
}
use of io.trino.plugin.hive.HiveTypeName in project trino by trinodb.
the class AbstractFileFormat method createSchema.
static Properties createSchema(HiveStorageFormat format, List<String> columnNames, List<Type> columnTypes) {
Properties schema = new Properties();
schema.setProperty(SERIALIZATION_LIB, format.getSerde());
schema.setProperty(FILE_INPUT_FORMAT, format.getInputFormat());
schema.setProperty(META_TABLE_COLUMNS, join(",", columnNames));
schema.setProperty(META_TABLE_COLUMN_TYPES, columnTypes.stream().map(HiveType::toHiveType).map(HiveType::getHiveTypeName).map(HiveTypeName::toString).collect(joining(":")));
return schema;
}
use of io.trino.plugin.hive.HiveTypeName in project trino by trinodb.
the class CheckpointWriter method buildSchemaProperties.
private static Properties buildSchemaProperties(List<String> columnNames, List<Type> columnTypes) {
// TODO copied out from DeltaLakePageSink. Extrat to utility class
Properties schema = new Properties();
schema.setProperty(IOConstants.COLUMNS, String.join(",", columnNames));
schema.setProperty(IOConstants.COLUMNS_TYPES, columnTypes.stream().map(DeltaHiveTypeTranslator::toHiveType).map(HiveType::getHiveTypeName).map(HiveTypeName::toString).collect(joining(":")));
return schema;
}
use of io.trino.plugin.hive.HiveTypeName in project trino by trinodb.
the class DeltaLakePageSink method buildSchemaProperties.
static Properties buildSchemaProperties(List<String> columnNames, List<Type> columnTypes) {
Properties schema = new Properties();
schema.setProperty(IOConstants.COLUMNS, String.join(",", columnNames));
schema.setProperty(IOConstants.COLUMNS_TYPES, columnTypes.stream().map(DeltaHiveTypeTranslator::toHiveType).map(HiveType::getHiveTypeName).map(HiveTypeName::toString).collect(joining(":")));
return schema;
}
Aggregations