-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Decimal256 to ScalarValue
#7048
Conversation
@@ -1038,6 +1054,7 @@ macro_rules! impl_op_arithmetic { | |||
get_sign!($OPERATION), | |||
true, | |||
)))), | |||
// todo: Add Decimal256 support |
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.
The error DataFusion error: Internal error: Operator \+ is not implemented for types Decimal256\(None,15,2\) and Decimal256\(Some\(12300\),15,2\)\.
from running
create table t as values (arrow_cast(123, 'Decimal256(5,2)'));
select AVG(column1) from t;
in decimal.slt comes from lack of implementation of Decimal256 Scalar arithmetic op.
It seems to be not easy to finish right now. So I left it as todo here.
-- This feature is not implemented: Can't create a scalar from array of type "Decimal256(3, 2)" | ||
--arrow_cast(100, 'Decimal256(5,2)') as col_d256 | ||
arrow_cast(100, 'Decimal128(5,2)') as col_d128, | ||
arrow_cast(100, 'Decimal256(5,2)') as col_d256 |
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.
Now it is okay to create table using decimal256.
query RR | ||
SELECT | ||
col_d128, | ||
col_d256 | ||
FROM foo; | ||
---- | ||
100 100.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.
Though, I'm not sure why displayed value for decimal256 shows decimal points but decimal128 doesn't.
Needs to dig into where is the code for displaying it. But for now it seems minor to me. So just leave as is.
Oh, seems CI won't regen protobuf code? EDIT: Manually regen the protobuf code. |
Hmm, seems the failed tests in CI are unrelated. They are failed too on main branch as I run them locally |
I merged up from main to get the fix for #7078 I plan to merge this PR when CI passes |
Thank you @Dandandan @alamb |
Which issue does this PR close?
Closes #7049.
Related: #7046.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?