Search in sources :

Example 1 with ColumnDesign

use of com.facebook.presto.kudu.properties.ColumnDesign in project presto by prestodb.

the class KuduClientSession method toColumnSchema.

private ColumnSchema toColumnSchema(ColumnMetadata columnMetadata) {
    String name = columnMetadata.getName();
    ColumnDesign design = KuduTableProperties.getColumnDesign(columnMetadata.getProperties());
    Type ktype = TypeHelper.toKuduClientType(columnMetadata.getType());
    ColumnSchema.ColumnSchemaBuilder builder = new ColumnSchema.ColumnSchemaBuilder(name, ktype);
    builder.key(design.isPrimaryKey()).nullable(design.isNullable());
    setEncoding(name, builder, design);
    setCompression(name, builder, design);
    setTypeAttributes(columnMetadata, builder);
    return builder.build();
}
Also used : ColumnDesign(com.facebook.presto.kudu.properties.ColumnDesign) Type(org.apache.kudu.Type) DecimalType(com.facebook.presto.common.type.DecimalType) ColumnSchema(org.apache.kudu.ColumnSchema)

Aggregations

DecimalType (com.facebook.presto.common.type.DecimalType)1 ColumnDesign (com.facebook.presto.kudu.properties.ColumnDesign)1 ColumnSchema (org.apache.kudu.ColumnSchema)1 Type (org.apache.kudu.Type)1