Skip to content

Conversation

@uros-db
Copy link
Contributor

@uros-db uros-db commented Nov 12, 2025

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.

@uros-db uros-db changed the title [SPARK-54253] Add a guarding config for geospatial support [SPARK-54253][Geo][SQL] Add a guarding config for geospatial support Nov 12, 2025
@github-actions github-actions bot added the SQL label Nov 12, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a 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 .

@uros-db uros-db marked this pull request as draft November 12, 2025 11:34
Copy link
Contributor Author

@uros-db uros-db left a 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.

@dongjoon-hyun
Copy link
Member

Gentle ping, @uros-db . If there is no way, please turn it false always and enable it inside test cases.

@github-actions github-actions bot removed the CONNECT label Nov 14, 2025
@github-actions github-actions bot removed the CONNECT label Nov 17, 2025
@dongjoon-hyun
Copy link
Member

Please let me know when you are ready, @uros-db .

*/
def geospatialTypeWithSrid(sourceType: DataType, srid: Expression): DataType = {
sourceType match {
case _ if !SQLConf.get.geospatialEnabled =>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@uros-db uros-db requested a review from cloud-fan November 18, 2025 15:54
@uros-db uros-db marked this pull request as ready for review November 19, 2025 10:02
@uros-db
Copy link
Contributor Author

uros-db commented Nov 19, 2025

Hi folks all checks are good here, and I marked the PR ready as for review. @cloud-fan @dongjoon-hyun @holdenk

@cloud-fan
Copy link
Contributor

thanks, merging to master/4.1!

@cloud-fan cloud-fan closed this in d299684 Nov 19, 2025
cloud-fan pushed a commit that referenced this pull request Nov 19, 2025
### 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]>
@dongjoon-hyun
Copy link
Member

Thank you so much, @uros-db , @cloud-fan and all.

huangxiaopingRD pushed a commit to huangxiaopingRD/spark that referenced this pull request Nov 25, 2025
### 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]>
cloud-fan pushed a commit that referenced this pull request Dec 4, 2025
…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]>
cloud-fan pushed a commit that referenced this pull request Dec 4, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants