コード例 #1
0
    public static ColumnSchema FromProtobuf(ColumnSchemaPB columnSchemaPb)
    {
        var type           = (KuduType)columnSchemaPb.Type;
        var typeAttributes = columnSchemaPb.TypeAttributes.ToTypeAttributes();
        var defaultValue   = columnSchemaPb.HasWriteDefaultValue
            ? KuduEncoder.DecodeDefaultValue(
            type, typeAttributes, columnSchemaPb.WriteDefaultValue.Span)
            : null;

        return(new ColumnSchema(
                   columnSchemaPb.Name,
                   type,
                   columnSchemaPb.IsKey,
                   columnSchemaPb.IsNullable,
                   defaultValue,
                   columnSchemaPb.CfileBlockSize,
                   (EncodingType)columnSchemaPb.Encoding,
                   (CompressionType)columnSchemaPb.Compression,
                   typeAttributes,
                   columnSchemaPb.Comment));
    }