Java Code Examples for org.apache.kudu.ColumnSchema#Encoding

The following examples show how to use org.apache.kudu.ColumnSchema#Encoding . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KuduTableProperties.java    From presto with Apache License 2.0 6 votes vote down vote up
public static String lookupEncodingString(ColumnSchema.Encoding encoding)
{
    switch (encoding) {
        case AUTO_ENCODING:
            return "auto";
        case BIT_SHUFFLE:
            return "bitshuffle";
        case DICT_ENCODING:
            return "dictionary";
        case PLAIN_ENCODING:
            return "plain";
        case PREFIX_ENCODING:
            return "prefix";
        case RLE:
            return "runlength";
        case GROUP_VARINT:
            return "group_varint";
        default:
            return "unknown";
    }
}
 
Example 2
Source File: KuduTableProperties.java    From presto with Apache License 2.0 5 votes vote down vote up
public static ColumnSchema.Encoding lookupEncoding(String encoding)
{
    switch (encoding.toLowerCase(Locale.ENGLISH)) {
        case "auto":
        case "auto_encoding":
            return ColumnSchema.Encoding.AUTO_ENCODING;
        case "bitshuffle":
        case "bit_shuffle":
            return ColumnSchema.Encoding.BIT_SHUFFLE;
        case "dictionary":
        case "dict_encoding":
            return ColumnSchema.Encoding.DICT_ENCODING;
        case "plain":
        case "plain_encoding":
            return ColumnSchema.Encoding.PLAIN_ENCODING;
        case "prefix":
        case "prefix_encoding":
            return ColumnSchema.Encoding.PREFIX_ENCODING;
        case "runlength":
        case "run_length":
        case "run length":
        case "rle":
            return ColumnSchema.Encoding.RLE;
        case "group_varint":
            return ColumnSchema.Encoding.GROUP_VARINT;
        default:
            throw new IllegalArgumentException();
    }
}
 
Example 3
Source File: KuduClientSession.java    From presto with Apache License 2.0 5 votes vote down vote up
private void setEncoding(String name, ColumnSchema.ColumnSchemaBuilder builder, ColumnDesign design)
{
    if (design.getEncoding() != null) {
        try {
            ColumnSchema.Encoding encoding = KuduTableProperties.lookupEncoding(design.getEncoding());
            builder.encoding(encoding);
        }
        catch (IllegalArgumentException e) {
            throw new PrestoException(GENERIC_INTERNAL_ERROR, "Unknown encoding " + design.getEncoding() + " for column " + name);
        }
    }
}
 
Example 4
Source File: NativeKuduClientSession.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
private void setEncoding(String name, ColumnSchema.ColumnSchemaBuilder builder, ColumnDesign design) {
    if (design.getEncoding() != null) {
        try {
            ColumnSchema.Encoding encoding =
                    ColumnSchema.Encoding.valueOf(design.getEncoding().toUpperCase());
            builder.encoding(encoding);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Unknown encoding " + design.getEncoding() + " for column " + name);
        }
    }
}
 
Example 5
Source File: KuduColumnInfo.java    From flink-learning with Apache License 2.0 4 votes vote down vote up
Encoding(ColumnSchema.Encoding encode) {
    this.encode = encode;
}
 
Example 6
Source File: KuduColumnInfo.java    From flink-learning with Apache License 2.0 4 votes vote down vote up
Encoding(ColumnSchema.Encoding encode) {
    this.encode = encode;
}