-
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
support decimal data type in create table #1431
Conversation
datafusion/src/sql/planner.rs
Outdated
// TODO add bound checker in some utils file or function | ||
if *p > 38 || *s > *p { | ||
return Err(DataFusionError::Internal(format!( | ||
"Error Decimal Type ({:?})", |
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.
A slightly more informative error would be better, such as "precision above 38 / scale bigger than precision" not supported.
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.
Thanks for your suggestion.
It has been modified.
// TODO add bound checker in some utils file or function | ||
if *p > 38 || *s > *p { | ||
return Err(DataFusionError::Internal(format!( | ||
"Error Decimal Type ({:?})", |
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.
Same here
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.
datafusion/tests/sql.rs
Outdated
async fn register_simple_aggregate_csv_with_decimal_by_sql(ctx: &mut ExecutionContext) { | ||
let df = ctx | ||
.sql( | ||
" CREATE EXTERNAL TABLE aggregate_simple ( |
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.
" CREATE EXTERNAL TABLE aggregate_simple ( | |
"CREATE EXTERNAL TABLE aggregate_simple ( |
PTAL @Dandandan again. |
@alamb please merge this. |
Thanks @liukun4515 |
🎉 Thank you very much @liukun4515 , @Dandandan and @houqp |
))); | ||
} | ||
(Some(p), Some(s)) => { | ||
// TODO add bound checker in some utils file or function |
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.
👍
#[tokio::test] | ||
async fn csv_query_with_decimal_by_sql() -> Result<()> { | ||
let mut ctx = ExecutionContext::new(); | ||
register_simple_aggregate_csv_with_decimal_by_sql(&mut ctx).await; |
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.
Nice
…create table (apache#1431)" * support decimal data type in create table Can drop this after rebase on commit dc80c11, first released in 7.0.0
Which issue does this PR close?
related #122
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?