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

create_index.benchmark throws me an Out of Range Error #2310

Closed
JigaoLuo opened this issue Sep 21, 2021 · 2 comments
Closed

create_index.benchmark throws me an Out of Range Error #2310

JigaoLuo opened this issue Sep 21, 2021 · 2 comments

Comments

@JigaoLuo
Copy link
Contributor

JigaoLuo commented Sep 21, 2021

What does happen?
create_index.benchmark throws me an Out of Range Error
The benchmark has this SQL as issue: CREATE TABLE integers AS SELECT (i * 9876983769044 % 10000000) AS i FROM range(0, 10000000) t(i);

The duckdb executable can't handle this query:

v0.2.10-dev339 eb63d0af8
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D CREATE TABLE integers AS SELECT (i * 9876983769044 % 10000000) AS i FROM range(0, 10000000) t(i);
Error: Out of Range Error: Overflow in multiplication of INT64 (933825 * 9876983769044)!

What should happen?

Hard to define: the compiler could do constant propagation and constant folding in optimization passes.
It is reasonable, that this SQL throws an Out of Range Error.
But this SQL with error should not be included into the benchmark.

To Reproduce
Steps to reproduce the behavior. Bonus points if those are only SQL queries.

  1. .duckdb
  2. CREATE TABLE integers AS SELECT (i * 9876983769044 % 10000000) AS i FROM range(0, 10000000) t(i);

or

  1. BUILD_BENCHMARK=1 BUILD_TPCH=1 make
  2. build/release/benchmark/benchmark_runner benchmark/micro/index/create_index.benchmark

Environment (please complete the following information):

  • OS: Linux 5.10.63-1-MANJARO # 1 SMP PREEMPT Wed Sep 8 14:13:59 UTC 2021
  • DuckDB Version: v0.2.10-dev339 eb63d0af8

Before submitting

  • [Yes] Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
  • [Yes] Have you tried this on the latest master branch? In case you cannot compile, you may find some binaries here: https://github.com/duckdb/duckdb/releases/tag/master-builds
@JigaoLuo
Copy link
Contributor Author

My question is:
What should happen with this benchmark/micro/index/create_index.benchmark?

@hawkfish
Copy link
Contributor

It needs to have some explicit casts:

CREATE TABLE integers AS SELECT (i * 9876983769044::INT128 % 10000000)::INT64 AS i FROM range(0, 10000000) t(i);

I will submit a small PR for this.

hawkfish pushed a commit to hawkfish/duckdb that referenced this issue Sep 21, 2021
Added some casts to fix Out of range Error.
Mytherin added a commit that referenced this issue Sep 22, 2021
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

2 participants