Skip to content
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

Tracking: Support DataType::Decimal #2931

Closed
14 of 17 tasks
sundy-li opened this issue Nov 21, 2021 · 5 comments · Fixed by #10369
Closed
14 of 17 tasks

Tracking: Support DataType::Decimal #2931

sundy-li opened this issue Nov 21, 2021 · 5 comments · Fixed by #10369
Assignees
Labels
A-planner Area: planner/optimizer A-query Area: databend query

Comments

@sundy-li
Copy link
Member

sundy-li commented Nov 21, 2021

Summary

Description for this feature.

Now we have introduced Decimal128 and Decimal256 types, let's add more features on decimal types.

Below is old comments:

Decimal is Synonymous with Number type.

It represents a range up to 38 digits, with an optional precision and scale:

Precision:
Total number of digits allowed.

Scale:
Number of digits allowed to the right of the decimal point.

By default Number means NUMBER(38,0) or Decimal(38, 0)

Width Internal Size (Bytes)
1-4 INT16 2
5-9 INT32 4
10-18 INT64 8
19-38 INT128 16
@sundy-li sundy-li added the A-query Area: databend query label Nov 21, 2021
@liukun4515
Copy link

Hi @sundy-li, I have a question about decimal data type which will be implemented in the feature.
From the datatype, we know the native data type(i32,i64) is simple. when add the decimal, we need to consider the precision and scale, refine the data type coercion.

Does the community has the plan to implement it?

@sundy-li
Copy link
Member Author

sundy-li commented Nov 24, 2021

How about making decimal's physical_type to Int128 ?
As arrow did https://github.com/jorgecarleitao/arrow2/blob/main/src/datatypes/mod.rs#L247

@sundy-li sundy-li added the good first issue Category: good first issue label Jun 13, 2022
@youngsofun youngsofun self-assigned this Jun 23, 2022
@BohuTANG BohuTANG mentioned this issue Jan 12, 2023
9 tasks
@sundy-li sundy-li assigned andylokandy and sundy-li and unassigned youngsofun Jan 28, 2023
@andylokandy andylokandy added A-planner Area: planner/optimizer and removed good first issue Category: good first issue labels Jan 28, 2023
@sundy-li sundy-li changed the title Support DataType::Decimal [Tracking] Support DataType::Decimal Feb 10, 2023
@sundy-li sundy-li changed the title [Tracking] Support DataType::Decimal Tracking: Support DataType::Decimal Feb 10, 2023
@youngsofun
Copy link
Member

do we need to/ able to support Decimal when check results column types in the sql logical test?

@sundy-li
Copy link
Member Author

do we need to/ able to support Decimal when check results column types in the sql logical test?

Decimal will be formatted into string, so it's same as check string result.

@BohuTANG
Copy link
Member

@sundy-li

We also need a task: put the decimal-type column stats to segment to fast pruning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-planner Area: planner/optimizer A-query Area: databend query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants