You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2023/03/01 22:05:03 UTC

[GitHub] [spark] ueshin opened a new pull request, #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema

ueshin opened a new pull request, #40240:
URL: https://github.com/apache/spark/pull/40240

   ### What changes were proposed in this pull request?
   
   Fixes `createDataFrame` to support DDL string as schema.
   
   ### Why are the changes needed?
   
   Currently DDL string as schema is ignored when the data is Python objects and the inference fails:
   
   ```py
   >>> spark.createDataFrame([(100, None)], "age INT, name STRING").show()
   Traceback (most recent call last):
   ...
   ValueError: Some of types cannot be determined after inferring, a StructType Schema is required in this case
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   The DDL string as schema will not be ignored when the schema can't be inferred from the given data.
   
   ```py
   >>> spark.createDataFrame([(100, None)], "age INT, name STRING").show()
   +---+----+
   |age|name|
   +---+----+
   |100|null|
   +---+----+
   ```
   
   ### How was this patch tested?
   
   Enabled related tests.


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #40240:
URL: https://github.com/apache/spark/pull/40240#issuecomment-1451076639

   Merged to master and branch-3.4.


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on pull request #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #40240:
URL: https://github.com/apache/spark/pull/40240#issuecomment-1451104705

   good catch, we may leverage the new proto `DDLParse` later


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ueshin commented on pull request #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #40240:
URL: https://github.com/apache/spark/pull/40240#issuecomment-1451141281

   > we may leverage the new proto `DDLParse` later
   
   Sounds good. Are you working on it? Please let me know once it's done. I'll address it.


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon closed pull request #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #40240: [SPARK-42458][CONNECT][PYTHON] Fixes createDataFrame to support DDL string as schema
URL: https://github.com/apache/spark/pull/40240


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org