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

Using show() after DISTINCT on INTs causes query to hang in Python #9750

Closed
1 task done
andre214 opened this issue Nov 21, 2023 · 2 comments
Closed
1 task done

Using show() after DISTINCT on INTs causes query to hang in Python #9750

andre214 opened this issue Nov 21, 2023 · 2 comments

Comments

@andre214
Copy link

What happens?

I wanted to get some unique values from a table in Python but it seems that when I try to .show() the result, something causes it to freeze.

Here's the research I've conducted so far:

  • I can .show() the same query without using DISTINCT and it displays the result instantly
  • I can also use .fetchall() and DISTINCT and it works instantly
  • It seems the number of duplicates seems to affect whether this happens. In a table with around 16000 unique values all repeated 5 times, the bug occurs but when the IDs are all unique it doesn't
  • If the values are doubles rather than ints, the bug doesn't occur

To Reproduce

The subquery is just to generate a table with INTs 0 to 16000 all repeated 5 times.

import duckdb
duckdb.sql("""
  SELECT DISTINCT y FROM (
      SELECT cast(floor(generate_series/5) AS INT) AS y FROM generate_series(16000*5)
)
""").show()

OS:

Windows 10 x64

DuckDB Version:

0.9.3.dev42

DuckDB Client:

Python

Full Name:

andre214

Affiliation:

personal

Have you tried this on the latest main branch?

I have tested with a main build

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

  • Yes, I have
@szarnyasg
Copy link
Collaborator

This indeed hangs on the current dev version.

@Tishj
Copy link
Contributor

Tishj commented Feb 8, 2024

I think this has been fixed by #10503 or #10318

On the latest dev version it doesn't hang anymore.

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

No branches or pull requests

4 participants