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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
