-
Notifications
You must be signed in to change notification settings - Fork 253
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.10% +2.97%
- Complexity 976 1475 +499
============================================
Files 119 165 +46
Lines 11743 15068 +3325
Branches 2251 2508 +257
============================================
+ Hits 6591 8906 +2315
- Misses 4012 4895 +883
- Partials 1140 1267 +127 ☔ 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? 🤔
| 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 ?
|
|
||
| override def getSupportLevel(expr: MakeDecimal): SupportLevel = { | ||
| expr.child.dataType match { | ||
| case _: LongType => Compatible() |
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.
| case _: LongType => Compatible() | |
| case LongType => Compatible() |
because LongType is an object/singleton
| 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
Which issue does this PR close?
Closes #2813
Rationale for this change
What changes are included in this PR?
How are these changes tested?