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

ASF GitHub Bot commented on HUDI-2063:
--------------------------------------

nsivabalan commented on a change in pull request #3140:
URL: https://github.com/apache/hudi/pull/3140#discussion_r686967966



##########
File path: website/docs/quick-start-guide.md
##########
@@ -119,6 +142,85 @@ The 
[DataGenerator](https://github.com/apache/hudi/blob/master/hudi-spark/src/ma
 can generate sample inserts and updates based on the the sample trip schema 
[here](https://github.com/apache/hudi/blob/master/hudi-spark/src/main/java/org/apache/hudi/QuickstartUtils.java#L57)
 :::
 
+## Create Table
+
+Hudi support create table using spark-sql.
+
+**Create Non-Partitioned Table**
+```sql
+-- create a managed cow table
+create table if not exists h0(
+  id int, 
+  name string, 
+  price double
+) using hudi
+options (
+  type = 'cow',
+  primaryKey = 'id'
+);
+
+-- creae an external mor table
+create table if not exists h1(
+  id int, 
+  name string, 
+  price double,
+  ts bigint
+) using hudi
+location '/tmp/hudi/h0'  
+options (
+  type = 'mor',
+  primaryKey = 'id,name',
+  preCombineField = 'ts' 
+)
+;
+
+-- create a non-primary key table
+create table if not exists h2(
+  id int, 
+  name string, 
+  price double
+) using hudi
+options (
+  type = 'cow'
+);
+```
+**Create Partitioned Table**
+```sql
+create table if not exists h_p0 (
+id bigint,
+name string,
+dt string,
+hh string  
+) using hudi
+location '/tmp/hudi/h_p0'
+options (
+  type = 'cow',
+  primaryKey = 'id',
+  preCombineField = 'ts'
+ ) 
+partitioned by (dt, hh)
+;
+```
+**Create Table On The Exists Table Path**
+
+We can create a table on an exists hudi table path. This is useful to 
read/write from a non-sql hudi table by spark-sql.
+```sql
+ create table h_p1 using hudi 
+ options (
+    primaryKey = 'id',
+    preCombineField = 'ts'
+ )
+ partitioned by (dt)
+ location '/path/to/hudi'
+```
+
+**Create Table Options**
+
+| Parameter Name | Introduction |
+|------------|--------|
+| primaryKey | The primary key names of the table, multiple fields separated 
by commas. |
+| type       | The table type to create. type = 'cow' means a COPY-ON-WRITE 
table,while type = 'mor' means a MERGE-ON-READ table. Default value is 'cow' 
without specified this option.|
+| preCombineField | The Pre-Combine field of the table. |

Review comment:
       sure, sounds good. but just a 1 liner like, "to set custom hoodie 
configs for a table, check _Set Hudi Config_ section" would help. 

##########
File path: website/docs/quick-start-guide.md
##########
@@ -119,6 +142,85 @@ The 
[DataGenerator](https://github.com/apache/hudi/blob/master/hudi-spark/src/ma
 can generate sample inserts and updates based on the the sample trip schema 
[here](https://github.com/apache/hudi/blob/master/hudi-spark/src/main/java/org/apache/hudi/QuickstartUtils.java#L57)
 :::
 
+## Create Table
+
+Hudi support create table using spark-sql.
+
+**Create Non-Partitioned Table**

Review comment:
       Is this feedback addressed? i.e. 1 to 2 line brief intro about pk, 
non-pk table, partitioned, non-partitioned table, managed vs external table. 
   
   Introduce a section called "Terminologies" or something at the beginning of 
sql dml and then explain these details there before we dive into create table 
commands.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> [SQL] Add Doc For Spark Sql Integrates With Hudi
> ------------------------------------------------
>
>                 Key: HUDI-2063
>                 URL: https://issues.apache.org/jira/browse/HUDI-2063
>             Project: Apache Hudi
>          Issue Type: Sub-task
>          Components: Docs
>            Reporter: pengzhiwei
>            Assignee: pengzhiwei
>            Priority: Blocker
>              Labels: pull-request-available, release-blocker
>             Fix For: 0.9.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to