-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54253][Geo][SQL] Add a guarding config for geospatial support #53009
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
dongjoon-hyun
left a comment
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.
Nice! Thank you so much for proposing this new configuration, @uros-db .
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/st/stExpressions.scala
Outdated
Show resolved
Hide resolved
uros-db
left a comment
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.
I'm converting this PR to draft while I figure out how to enforce the config in testing for Connect (e.g. ArrowEncoderSuite) and clear those failures. Not sure how to do this at the moment, because static SQL config values can't be changed, and modifying testConfigs in SparkConnectServerUtils doesn't help either because isTesting stays false and config value is not propagated between server & client.
|
Gentle ping, @uros-db . If there is no way, please turn it |
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/catalyst/encoders/AgnosticEncoder.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeographyType.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/st/stExpressions.scala
Outdated
Show resolved
Hide resolved
.../client/jvm/src/test/scala/org/apache/spark/sql/connect/client/arrow/ArrowEncoderSuite.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeometryType.scala
Outdated
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/types/GeometryType.scala
Outdated
Show resolved
Hide resolved
|
Please let me know when you are ready, @uros-db . |
| */ | ||
| def geospatialTypeWithSrid(sourceType: DataType, srid: Expression): DataType = { | ||
| sourceType match { | ||
| case _ if !SQLConf.get.geospatialEnabled => |
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.
is it a narrow waist for geo functionalities?
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.
Yes, this is very narrow wrt. geo. It's exclusively used in ST expressions (currently only 1 expression, but will be re-used in a few more) to determine the resulting dataType.
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/st/stExpressions.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/st/stExpressions.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/types/PhysicalDataType.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/STExpressionsSuite.scala
Outdated
Show resolved
Hide resolved
|
Hi folks all checks are good here, and I marked the PR ready as for review. @cloud-fan @dongjoon-hyun @holdenk |
|
thanks, merging to master/4.1! |
### What changes were proposed in this pull request? Introduce a new SQL config for controlling the geospatial feature: ``` spark.sql.geospatial.enabled ``` The default value is `false`, and enabled only in testing. ### Why are the changes needed? Guard the geospatial feature until it's fully finished. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added appropriate unit tests to confirm that the config is effective: - `STExpressionsSuite` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53009 from uros-db/geo-config. Authored-by: Uros Bojanic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit d299684) Signed-off-by: Wenchen Fan <[email protected]>
|
Thank you so much, @uros-db , @cloud-fan and all. |
### What changes were proposed in this pull request? Introduce a new SQL config for controlling the geospatial feature: ``` spark.sql.geospatial.enabled ``` The default value is `false`, and enabled only in testing. ### Why are the changes needed? Guard the geospatial feature until it's fully finished. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added appropriate unit tests to confirm that the config is effective: - `STExpressionsSuite` ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#53009 from uros-db/geo-config. Authored-by: Uros Bojanic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
…ig in Spark Connect ### What changes were proposed in this pull request? A new SQL config (`spark.sql.geospatial.enabled`) was introduced as part of #53009. However, the original PR didn't fully gate geospatial functionality, so this PR also forbids geo dataframes in Spark Connect. ### Why are the changes needed? Guard the geospatial feature until it's fully finished. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added appropriate unit tests to confirm that the config is effective: - `GeographyConnectDataFrameSuite` - `GeometryConnectDataFrameSuite` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53259 from uros-db/geo-config_connect_tests. Authored-by: Uros Bojanic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
…ig in Spark Connect ### What changes were proposed in this pull request? A new SQL config (`spark.sql.geospatial.enabled`) was introduced as part of #53009. However, the original PR didn't fully gate geospatial functionality, so this PR also forbids geo dataframes in Spark Connect. ### Why are the changes needed? Guard the geospatial feature until it's fully finished. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added appropriate unit tests to confirm that the config is effective: - `GeographyConnectDataFrameSuite` - `GeometryConnectDataFrameSuite` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53259 from uros-db/geo-config_connect_tests. Authored-by: Uros Bojanic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 38d6010) Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
Introduce a new SQL config for controlling the geospatial feature:
The default value is
false, and enabled only in testing.Why are the changes needed?
Guard the geospatial feature until it's fully finished.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added appropriate unit tests to confirm that the config is effective:
STExpressionsSuiteWas this patch authored or co-authored using generative AI tooling?
No.