-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: Improve cast compatibility tests and docs #379
Conversation
@@ -347,7 +364,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper { | |||
Short.MaxValue.toFloat, | |||
0.0f) ++ | |||
Range(0, dataSize).map(_ => r.nextFloat()) | |||
withNulls(values).toDF("a") | |||
castTest(withNulls(values).toDF("a"), DataTypes.StringType) |
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.
Fixing a regression that was introduced in #346
@@ -401,7 +418,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper { | |||
Double.NegativeInfinity, | |||
0.0d) ++ | |||
Range(0, dataSize).map(_ => r.nextDouble()) | |||
withNulls(values).toDF("a") | |||
castTest(withNulls(values).toDF("a"), DataTypes.StringType) |
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.
Fixing a regression that was introduced in #346
@@ -795,7 +812,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper { | |||
Seq( | |||
"2024-01-01T12:34:56.123456", | |||
"2024-01-01T01:00:00Z", | |||
"2024-12-31T01:00:00-02:00", | |||
"9999-12-31T01:00:00-02:00", |
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.
Just making sure we have a wider range of years being tested
if (line.trim == "<!--CAST_TABLE-->") { | ||
w.write("| From Type | To Type | Compatible? | Notes |\n".getBytes) | ||
w.write("|-|-|-|-|\n".getBytes) | ||
if (line.trim == "<!--COMPAT_CAST_TABLE-->") { |
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.
There was previously one table, but now we show separate tables for compatible and incompatible.
@@ -253,7 +253,8 @@ class CometExecSuite extends CometTestBase { | |||
dataTypes.map { subqueryType => | |||
withSQLConf( | |||
CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true", | |||
CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") { | |||
CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true", | |||
CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key -> "true") { |
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.
This test needs binary -> string casts
@viirya @snmvaughan This PR incorporates some of the feedback from #362 |
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.
Looks good to me. Thanks @andygrove
Which issue does this PR close?
Part of #286
Rationale for this change
What changes are included in this PR?
Docs Preview
We have a table of compatible casts, followed by:
How are these changes tested?
Tested docs locally.