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

[WASM] Get wrong result, using Array with Interval #1203

Closed
2 tasks done
zhejiangxiaomai opened this issue Dec 16, 2022 · 3 comments
Closed
2 tasks done

[WASM] Get wrong result, using Array with Interval #1203

zhejiangxiaomai opened this issue Dec 16, 2022 · 3 comments
Assignees

Comments

@zhejiangxiaomai
Copy link

What happens?

When I use array with Interval. The result is not as expected.

To Reproduce

using https://shell.duckdb.org/
When I type "select INTERVAL 30 SECONDS;", result is 00:00:30.
But the strange thing is
When I type "select ARRAY[INTERVAL 30 SECONDS];", result is 00:00:00.030 .
image

OS:

DuckDB Web Shell

DuckDB Version:

v0.0.1-dev0

DuckDB Client:

web

Full Name:

zhenhui zhao

Affiliation:

[email protected]

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
@Mytherin
Copy link
Contributor

Mytherin commented Dec 16, 2022

Thanks for the report!

It looks like this is exclusively a problem in the WASM version - likely related to the result set conversion there.

@Mytherin Mytherin changed the title Get wrong result, using Array with Interval [WASM] Get wrong result, using Array with Interval Dec 16, 2022
@Mytherin Mytherin transferred this issue from duckdb/duckdb Mar 23, 2023
@carlopi
Copy link
Collaborator

carlopi commented Mar 23, 2023

Hi @zhejiangxiaomai!

This looks like it's working now in a more "uniform way", but there has been an independent regression on this:

duckdb> select interval 30 seconds;
┌────────────────────────────────────────────────────────┐
│ to_seconds(CAST(30 AS BIGINT))                         │
╞════════════════════════════════════════════════════════╡
│ 0 years 6 mons -64771072 days 0 hours 0 mins 0.00 secs │
└────────────────────────────────────────────────────────┘
Elapsed: 32 ms

duckdb> select array [interval 30 seconds];
┌──────────────────────────────────────────────────────────┐
│ (ARRAY[to_seconds(CAST(30 AS BIGINT))])                  │
╞══════════════════════════════════════════════════════════╡
│ [0 years 6 mons -64771072 days 0 hours 0 mins 0.00 secs] │
└──────────────────────────────────────────────────────────┘
Elapsed: 10 ms

so that the result is currently non-sensical.

I will have a look, thanks for your report!

@carlopi
Copy link
Collaborator

carlopi commented Jun 17, 2024

Thanks, this is solved thanks to #1769

@carlopi carlopi closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants