[ 
https://issues.apache.org/jira/browse/KUDU-1737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16458992#comment-16458992
 ] 

Saketa Chalamchala commented on KUDU-1737:
------------------------------------------

Closing this JIRA 

Starting from Kudu Spark API version 1.7, kuduContext allows createTable 
function signature with Kudu Schema 
createTable(tableName: String, schema: org.apache.kudu.Schema, options: 
org.apache.kudu.client.CreateTableOptions)

org.apache.kudu.Schema allows the specification of optional Metadata along with 
mandatory column metadata
 String name;
 Type type;
 boolean key;
 boolean nullable;
 defaultValue;
 desiredBlockSize;
 Encoding encoding;
 CompressionAlgorithm compressionAlgorithm;
 ColumnTypeAttributes typeAttributes;
 int typeSize;

Ex : 
val columnList = new ArrayList[org.apache.kudu.ColumnSchema]()
 columnList.add(new org.apache.kudu.ColumnSchema.ColumnSchemaBuilder("name", 
Type.STRING).encoding(ColumnSchema.Encoding.DICT_ENCODING).key(true).build())
...
val schema = new org.apache.kudu.Schema(columnList)

kuduContext.createTable(tablename, schema, new 
org.apache.kudu.client.CreateTableOptions())

> Allow KuduContext to create table with column encodings
> -------------------------------------------------------
>
>                 Key: KUDU-1737
>                 URL: https://issues.apache.org/jira/browse/KUDU-1737
>             Project: Kudu
>          Issue Type: Improvement
>          Components: api
>    Affects Versions: 1.0.1
>            Reporter: Jeffrey Shmain
>            Assignee: Saketa Chalamchala
>            Priority: Minor
>
> Currently createTable method in KuduContext has no way to specify the column 
> encodings.  It uses  org.apache.spark.sql.types.StructType, and there seems 
> to be the way to specify optional Metadata in StructField.  
> new
> StructField(name: String, dataType: DataType, nullable: Boolean = true, 
> metadata: Metadata = Metadata.empty)
> Can we update the createTable method to parse out optional metadata and add 
> the encodings if specify.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to