You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/09/26 01:42:54 UTC

[GitHub] [incubator-kyuubi] bowenliang123 opened a new pull request, #3552: [KYUUBI #3406] [FOLLOWUP] Add Create datasource table usage to Pyspark docs

bowenliang123 opened a new pull request, #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Following #3406 , fixing spelling mistakes  and  adding new DDL usage for jdbc source in  PySpark client docs.
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979574103


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL

Review Comment:
   the content contains other SQL-style examples as well



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979575347


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL

Review Comment:
   ok, well known.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979577436


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL
+
+From Spark 3.2.0, [`CREATE DATASOURCE TABLE`](https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html) is supported to create jdbc source with SQL.
+
+
+```python
+# create JDBC Datasource table with DDL
+spark.sql("""CREATE TABLE kyuubi_table USING JDBC
+OPTIONS (
+    driver='org.apache.hive.jdbc.HiveDriver',
+    url='jdbc:hive2://kyuubi_server_ip:port',
+    user='user',
+    password='password',
+    dbtable='testdb.some_table'
+)""")
+
+# read data to dataframe
+jdbcDF = spark.sql("SELECT * FROM kyuubi_table")
+
+# write data from dataframe
+df.writeTo("kyuubi_table")

Review Comment:
   Thx for reminding me.  As `append` mode is not yet available since neither Hive nor Kyuubi's JDBC driver supports `addBatch`/`excuteBatch` mode, `overwrite` mode is added in this sample.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#issuecomment-1257581092

   Thanks for the quick review and merging.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979553603


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL

Review Comment:
   DDL => SQL ?



##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL
+
+From Spark 3.2.0, [`CREATE DATASOURCE TABLE`](https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html) is supported to create jdbc source with SQL.
+
+
+```python
+# create JDBC Datasource table with DDL
+spark.sql("""CREATE TABLE kyuubi_table USING JDBC
+OPTIONS (
+    driver='org.apache.hive.jdbc.HiveDriver',
+    url='jdbc:hive2://kyuubi_server_ip:port',
+    user='user',
+    password='password',
+    dbtable='testdb.some_table'
+)""")
+
+# read data to dataframe
+jdbcDF = spark.sql("SELECT * FROM kyuubi_table")
+
+# write data from dataframe
+df.writeTo("kyuubi_table")

Review Comment:
   in scala, it should be `df.writeTo("kyuubi_table").append`, not sure python



##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL
+
+From Spark 3.2.0, [`CREATE DATASOURCE TABLE`](https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html) is supported to create jdbc source with SQL.
+
+
+```python
+# create JDBC Datasource table with DDL
+spark.sql("""CREATE TABLE kyuubi_table USING JDBC
+OPTIONS (
+    driver='org.apache.hive.jdbc.HiveDriver',
+    url='jdbc:hive2://kyuubi_server_ip:port',
+    user='user',
+    password='password',
+    dbtable='testdb.some_table'
+)""")
+
+# read data to dataframe
+jdbcDF = spark.sql("SELECT * FROM kyuubi_table")
+
+# write data from dataframe
+df.writeTo("kyuubi_table")
+
+# write data from query
+spark.sql("INSERT INTO kyuubi_table select * from some_table")

Review Comment:
   ```suggestion
   spark.sql("INSERT INTO kyuubi_table SELECT * FROM some_table")
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979573268


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL

Review Comment:
   'DDL' here means usage of "create table using jdbc" command. Any better idea for this title?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#discussion_r979576592


##########
docs/client/python/pyspark.md:
##########
@@ -106,6 +106,32 @@ jdbcDF.write \
     .save()
 ```
 
+### Using as JDBC Datasource table with DDL
+
+From Spark 3.2.0, [`CREATE DATASOURCE TABLE`](https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html) is supported to create jdbc source with SQL.
+
+
+```python
+# create JDBC Datasource table with DDL
+spark.sql("""CREATE TABLE kyuubi_table USING JDBC
+OPTIONS (
+    driver='org.apache.hive.jdbc.HiveDriver',
+    url='jdbc:hive2://kyuubi_server_ip:port',
+    user='user',
+    password='password',
+    dbtable='testdb.some_table'
+)""")
+
+# read data to dataframe
+jdbcDF = spark.sql("SELECT * FROM kyuubi_table")
+
+# write data from dataframe
+df.writeTo("kyuubi_table")
+
+# write data from query
+spark.sql("INSERT INTO kyuubi_table select * from some_table")

Review Comment:
   ok



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#issuecomment-1257579130

   Thanks, merging to master/1.6


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3552:
URL: https://github.com/apache/incubator-kyuubi/pull/3552#issuecomment-1257505650

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3552](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8ab4638) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/f1c49bb75c36079efd7feb0a61f284069bbab977?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f1c49bb) will **decrease** coverage by `0.04%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 8ab4638 differs from pull request most recent head 1fbe707. Consider uploading reports for the commit 1fbe707 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3552      +/-   ##
   ============================================
   - Coverage     51.72%   51.68%   -0.05%     
     Complexity       13       13              
   ============================================
     Files           482      482              
     Lines         26950    26950              
     Branches       3761     3761              
   ============================================
   - Hits          13940    13928      -12     
   - Misses        11654    11664      +10     
   - Partials       1356     1358       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../kyuubi/server/mysql/constant/MySQLErrorCode.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvbXlzcWwvY29uc3RhbnQvTXlTUUxFcnJvckNvZGUuc2NhbGE=) | `13.84% <0.00%> (-6.16%)` | :arrow_down: |
   | [...ache/kyuubi/server/mysql/MySQLCommandHandler.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvbXlzcWwvTXlTUUxDb21tYW5kSGFuZGxlci5zY2FsYQ==) | `75.00% <0.00%> (-4.55%)` | :arrow_down: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `79.45% <0.00%> (-2.74%)` | :arrow_down: |
   | [...ache/kyuubi/server/mysql/MySQLGenericPackets.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvbXlzcWwvTXlTUUxHZW5lcmljUGFja2V0cy5zY2FsYQ==) | `76.59% <0.00%> (-2.13%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `52.63% <0.00%> (-1.32%)` | :arrow_down: |
   | [...org/apache/kyuubi/operation/ExecuteStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3552/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vRXhlY3V0ZVN0YXRlbWVudC5zY2FsYQ==) | `79.16% <0.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 closed pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs

Posted by GitBox <gi...@apache.org>.
pan3793 closed pull request #3552: [KYUUBI #3406] [FOLLOWUP] Add create datasource table DDL usage to Pyspark docs
URL: https://github.com/apache/incubator-kyuubi/pull/3552


-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org