-
Couldn't load subscription status.
- Fork 1.9k
[KERNEL] Extend getStatsSchema to include collated stats
#5380
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
Open
ilicmarkodb
wants to merge
20
commits into
delta-io:master
Choose a base branch
from
ilicmarkodb:extend_stats_schema
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dc9cba1
temp
ilicmarkodb 58ab107
fix test
ilicmarkodb cb21750
fix test
ilicmarkodb 9dfa0e1
fix test
ilicmarkodb 81560bb
scala style
ilicmarkodb 59a0ca9
make use of immutableUnion
ilicmarkodb bcebf4a
change comment
ilicmarkodb f4ffc71
java style
ilicmarkodb 607d309
address comments
ilicmarkodb 655188d
java style
ilicmarkodb 06add00
update comment
ilicmarkodb 651a251
pruneStatsSchema tests added
ilicmarkodb 48ede99
fix test
ilicmarkodb 06f2312
temp
ilicmarkodb 63e6b7c
fix
ilicmarkodb 308bece
fix test
ilicmarkodb 3f58796
fix test
ilicmarkodb 3d7d9d7
fix test
ilicmarkodb 608ae42
revert1
ilicmarkodb 80c4ed2
fix test
ilicmarkodb 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -188,6 +188,118 @@ class DataSkippingUtilsSuite extends AnyFunSuite with TestUtils { | |
| new StructType()) | ||
| } | ||
|
|
||
| test("pruneStatsSchema - collated min/max columns") { | ||
| val utf8Lcase = CollationIdentifier.fromString("SPARK.UTF8_LCASE") | ||
| val unicode = CollationIdentifier.fromString("ICU.UNICODE") | ||
| val testSchema = new StructType() | ||
|
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. nit - I think you could define vals to make this simpler that can be reused? val nestedField = ...
val s1Field = ...
val allFields = ... // (s1 + i1 + i2 + nested) |
||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("i1", INTEGER) | ||
| .add("i2", INTEGER) | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| MAX, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("i1", INTEGER) | ||
| .add("i2", INTEGER) | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| STATS_WITH_COLLATION, | ||
| new StructType() | ||
| .add( | ||
| utf8Lcase.toString, | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| MAX, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("nested", new StructType().add("s2", StringType.STRING)))) | ||
| .add( | ||
| unicode.toString, | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| MAX, | ||
| new StructType() | ||
| .add("s1", StringType.STRING) | ||
| .add("nested", new StructType().add("s2", StringType.STRING))))) | ||
|
|
||
| val testCases = Seq( | ||
| ( | ||
| Set(nestedCol(s"$MIN.nested.s2"), nestedCol(s"$MAX.i1")), | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| MAX, | ||
| new StructType() | ||
| .add("i1", INTEGER))), | ||
| ( | ||
| Set( | ||
| collatedStatsCol(utf8Lcase, MIN, "s1"), | ||
| collatedStatsCol(unicode, MAX, "nested.s2")), | ||
| new StructType() | ||
| .add( | ||
| STATS_WITH_COLLATION, | ||
| new StructType() | ||
| .add( | ||
| utf8Lcase.toString, | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType().add("s1", StringType.STRING))) | ||
| .add( | ||
| unicode.toString, | ||
| new StructType() | ||
| .add( | ||
| MAX, | ||
| new StructType().add( | ||
| "nested", | ||
| new StructType().add("s2", StringType.STRING)))))), | ||
| ( | ||
| Set( | ||
| nestedCol(s"$MIN.i2"), | ||
| collatedStatsCol(utf8Lcase, MAX, "nested.s2"), | ||
| collatedStatsCol(utf8Lcase, MIN, "nested.s2")), | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("i2", INTEGER)) | ||
| .add( | ||
| STATS_WITH_COLLATION, | ||
| new StructType() | ||
| .add( | ||
| utf8Lcase.toString, | ||
| new StructType() | ||
| .add( | ||
| MIN, | ||
| new StructType() | ||
| .add("nested", new StructType().add("s2", StringType.STRING))) | ||
| .add( | ||
| MAX, | ||
| new StructType() | ||
| .add("nested", new StructType().add("s2", StringType.STRING))))))) | ||
|
|
||
| testCases.foreach { case (referencedCols, expectedSchema) => | ||
| checkPruneStatsSchema(testSchema, referencedCols, expectedSchema) | ||
| } | ||
| } | ||
|
|
||
| // TODO: add tests for remaining operators | ||
| test("check constructDataSkippingFilter") { | ||
| val testCases = Seq( | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.