-
Notifications
You must be signed in to change notification settings - Fork 258
fix: Fall back to Spark for MakeDecimal with unsupported input type #2815
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2815 +/- ##
============================================
+ Coverage 56.12% 59.14% +3.02%
- Complexity 976 1471 +495
============================================
Files 119 167 +48
Lines 11743 15238 +3495
Branches 2251 2514 +263
============================================
+ Hits 6591 9013 +2422
- Misses 4012 4942 +930
- Partials 1140 1283 +143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
| let result_type = DataType::Decimal128(precision, scale); | ||
| ColumnarValue::Array(a) => match a.data_type() { | ||
| DataType::Int64 => { |
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.
should we also support Int32? 🤔
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.
for this PR, I just wanted to fall back to avoid crashing. We could choose to add support in the future though
| SQLConf.ANSI_ENABLED.key -> "false", | ||
| SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false", | ||
| CometConf.getExprAllowIncompatConfigKey(classOf[Sum]) -> "true", | ||
| CometConf.COMET_NATIVE_SCAN_IMPL.key -> CometConf.SCAN_NATIVE_ICEBERG_COMPAT, |
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.
Are all settings needed for this test ? E.g. Sum and Iceberg compat look unrelated ?
spark/src/main/scala/org/apache/comet/serde/decimalExpressions.scala
Outdated
Show resolved
Hide resolved
| checkSparkAnswerAndFallbackReason(df1, "Unsupported input data type: IntegerType") | ||
| } | ||
| } | ||
| } |
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.
IMO it would be useful to add a positive test too - with LongType
….scala Co-authored-by: Martin Grigorov <[email protected]>
|
are we waiting to address any feedback on this PR? |
Which issue does this PR close?
Closes #2813
Rationale for this change
What changes are included in this PR?
How are these changes tested?