-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-53802][SDP] Support string values for user-specified schema in SDP tables #52517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
50b839e to
cb8ba44
Compare
| assert(graph.tables.size == 1) | ||
|
|
||
| val table = graph.table(graphIdentifier("table_with_string_schema")) | ||
| assert(table.specifiedSchema.isDefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shall we simply compare table.specifiedSchema with an expected schema (for example, StructType.fromDDL(id LONG, name STRING))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oo yeah was not aware of that
| optional spark.connect.DataType schema = 7; | ||
| oneof schema { | ||
| spark.connect.DataType schema_data_type = 7; | ||
| string schema_string = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Spark 4.1 is not offically released. I wonder if we can change the sequence numbers here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point – fixing
|
Thanks, merging to master |
…th `4.1.0-preview3` RC1 ### What changes were proposed in this pull request? This PR aims to update Spark Connect-generated Swift source code with Apache Spark `4.1.0-preview3` RC1. ### Why are the changes needed? There are many changes between Apache Spark 4.1.0-preview2 and preview3. - apache/spark#52685 - apache/spark#52613 - apache/spark#52553 - apache/spark#52532 - apache/spark#52517 - apache/spark#52514 - apache/spark#52487 - apache/spark#52328 - apache/spark#52200 - apache/spark#52154 - apache/spark#51344 To use the latest bug fixes and new messages to develop for new features of `4.1.0-preview3`. ``` $ git clone -b v4.1.0-preview3 https://github.com/apache/spark.git $ cd spark/sql/connect/common/src/main/protobuf/ $ protoc --swift_out=. spark/connect/*.proto $ protoc --grpc-swift_out=. spark/connect/*.proto // Remove empty GRPC files $ cd spark/connect $ grep 'This file contained no services' * | awk -F: '{print $1}' | xargs rm ``` ### Does this PR introduce _any_ user-facing change? Pass the CIs. ### How was this patch tested? Pass the CIs. I manually tested with `Apache Spark 4.1.0-preview3` (with the two SDP ignored tests). ``` $ swift test --no-parallel ... ✔ Test run with 203 tests in 21 suites passed after 19.088 seconds. ``` ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #252 from dongjoon-hyun/SPARK-54043. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
… SDP tables ### What changes were proposed in this pull request? When defining a streaming table or materialized view, enable passing a string to its schema, in addition to a StructType. This mimics the flexibility of [the `DataFrameReader` schema arg](https://spark.apache.org/docs/latest/api/python/reference/pyspark.ss/api/pyspark.sql.streaming.DataStreamReader.schema.html#pyspark.sql.streaming.DataStreamReader.schema). E.g. ```python from pyspark.sql.functions import lit dp.materialized_view(schema="id LONG, name STRING") def table_with_string_schema(): return spark.range(5).withColumn("name", lit("test")) ``` ### Why are the changes needed? For flexibility and consistency with similar args. ### Does this PR introduce _any_ user-facing change? Makes changes to unreleased protos. ### How was this patch tested? ### Was this patch authored or co-authored using generative AI tooling? Closes apache#52517 from sryza/dataset-schema-string. Authored-by: Sandy Ryza <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
What changes were proposed in this pull request?
When defining a streaming table or materialized view, enable passing a string to its schema, in addition to a StructType. This mimics the flexibility of the
DataFrameReaderschema arg.E.g.
Why are the changes needed?
For flexibility and consistency with similar args.
Does this PR introduce any user-facing change?
Makes changes to unreleased protos.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?