-
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
Changes from all commits
4d0d81c
be8fa77
3a1bc6f
d2253ca
1aaf63b
e744656
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,23 +180,29 @@ drop table foo | |
|
||
statement ok | ||
create table foo as select | ||
arrow_cast(100, 'Decimal128(5,2)') as col_d128 | ||
-- Can't make a decimal 156: | ||
-- 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 commentThe reason will be displayed to describe this comment to others. Learn more. Now it is okay to create table using decimal256. |
||
; | ||
|
||
|
||
## Ensure each column in the table has the expected type | ||
|
||
query T | ||
query TT | ||
SELECT | ||
arrow_typeof(col_d128) | ||
-- arrow_typeof(col_d256), | ||
arrow_typeof(col_d128), | ||
arrow_typeof(col_d256) | ||
FROM foo; | ||
---- | ||
Decimal128(5, 2) | ||
Decimal128(5, 2) Decimal256(5, 2) | ||
|
||
|
||
query RR | ||
SELECT | ||
col_d128, | ||
col_d256 | ||
FROM foo; | ||
---- | ||
100 100.00 | ||
Comment on lines
+199
to
+205
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. 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. |
||
|
||
statement ok | ||
drop table foo | ||
|
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 runningin 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.