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

Support type-coercion from Decimal to Float64 #2380

Closed
Tracked by #474
andygrove opened this issue Apr 29, 2022 · 2 comments · Fixed by #2396
Closed
Tracked by #474

Support type-coercion from Decimal to Float64 #2380

andygrove opened this issue Apr 29, 2022 · 2 comments · Fixed by #2396
Assignees
Labels
enhancement New feature or request

Comments

@andygrove
Copy link
Member

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

#[tokio::test]
async fn sql_abs_decimal() -> Result<()> {
    let ctx = SessionContext::new();
    register_decimal_csv_table_by_sql(&ctx).await;
    let sql = "SELECT abs(c1) from decimal_simple";
    let actual = execute_to_batches(&ctx, sql).await;

Fails with

Coercion from [Decimal(10, 6)] to the signature Uniform(1, [Float64, Float32]) failed.

Describe the solution you'd like
I would like the decimal to be coerced into a floating-point value.

Describe alternatives you've considered
None

Additional context
None

@comphead
Copy link
Contributor

@andygrove Please check the PR

@comphead
Copy link
Contributor

Opening new PR to resolve commit history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants