-
Notifications
You must be signed in to change notification settings - Fork 697
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
[SEDONA-480] Implement ST_S2ToGeom #1277
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
91fba09
feat: add ST_S2ToGeom
furqaankhan af4fb50
fix: lint error
furqaankhan 7413c63
fix: snowflake error
furqaankhan 513646a
fix: snowflake test 1/?
furqaankhan ea26b2c
fix: snowflake test 2
furqaankhan adcb936
fix: snowflake test 3
furqaankhan 4cb4cf2
fix: snowflake test 4
furqaankhan 9611f09
fix: remove function from snowflake
furqaankhan a7a2d8c
address changes
furqaankhan f4a2516
docs: add hints to docs
furqaankhan b9f2167
fix: lint issues
furqaankhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -752,6 +752,7 @@ public void test_ST_S2CellIDs() { | |
"[\n 1153031455769624576,\n 1152961087025446912,\n 1152925902653358080,\n 1152934698746380288,\n 1152943494839402496,\n 1152952290932424704,\n 1152969883118469120,\n 1152978679211491328,\n 1152987475304513536,\n 1152996271397535744,\n 1153005067490557952,\n 1153049047955668992,\n 1153057844048691200,\n 1153040251862646784,\n 1153084232327757824,\n 1153093028420780032,\n 1153066640141713408,\n 1153075436234735616,\n 1153101824513802240,\n 1153137008885891072,\n 1153189785444024320,\n 1153198581537046528,\n 1153172193257979904,\n 1153180989351002112,\n 1153163397164957696,\n 1153128212792868864,\n 1153013863583580160,\n 1153022659676602368,\n 1153242562002157568,\n 1153216173723090944,\n 1153277746374246400,\n 1153207377630068736,\n 1153224969816113152,\n 1153233765909135360,\n 1153268950281224192,\n 1153321726839357440,\n 1153365707304468480,\n 1153374503397490688,\n 1153400891676557312,\n 1153409687769579520,\n 1153383299490512896,\n 1153392095583535104,\n 1153436076048646144,\n 1153444872141668352,\n 1153418483862601728,\n 1153427279955623936,\n 1153453668234690560,\n 1153462464327712768,\n 1153330522932379648,\n 1921361385166471168,\n 1921475734375759872,\n 1921484530468782080,\n 1921493326561804288,\n 1921519714840870912,\n 1921528510933893120,\n 1921537307026915328,\n 384305702186778624,\n 1152389340979003392,\n 1152398137072025600,\n 1152406933165047808,\n 1152873126095224832,\n 1152881922188247040,\n 1152890718281269248,\n 1152917106560335872\n]" | ||
); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this change |
||
@Test | ||
public void test_ST_SetPoint() { | ||
registerUDF("ST_SetPoint", byte[].class, int.class, byte[].class); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,17 @@ class STS2CellIDs extends TestBaseScala with Matchers with GeometrySample with G | |
) | ||
} | ||
} | ||
|
||
describe("should pass ST_S2ToGeom") { | ||
it("should intersect with the target geometry") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add one more test to show that the result of ST_S2ToGeom can be used in ST_Collect to get a |
||
val baseDf = sparkSession.sql("SELECT ST_GeomFromWKT('POLYGON ((0.1 0.1, 0.5 0.1, 1 0.3, 1 1, 0.1 1, 0.1 0.1))') as geom") | ||
val df = baseDf.selectExpr("ST_S2ToGeom(ST_S2CellIDs(geom, 10)) as polygons", "geom") | ||
var intersectsDf = df.selectExpr("ST_Intersects(geom, polygons[0])") | ||
assert(intersectsDf.first().getBoolean(0)) | ||
intersectsDf = df.selectExpr("ST_Intersects(geom, polygons[20])") | ||
assert(intersectsDf.first().getBoolean(0)) | ||
intersectsDf = df.selectExpr("ST_Intersects(geom, polygons[100])") | ||
assert(intersectsDf.first().getBoolean(0)) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you clean up all these comments and println?
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.
My bad, I forgot about them.