DuckDB and a range slider

When a variable is integer, DuckDB automatically infers its type as integer. The problem is, when I query this using a Database Query with a WHERE clause (for example, WHERE x > ${value}), with value selected using a range slider, it gives an error after moving the slider many times (for example, about 50 times for a table with 1,000 rows). The error says:

RangeError: Maximum call stack size exceeded.

Interesting thing is, it doesn’t give the error when a variable is float. How can I change a variable type in DuckDB?

1 Like

Hi, I’m not able to reproduce this. Could you share a few example rows from your dataset, or ideally an example notebook where the problem occurs?

Hi, here is the notebook. If you move the slider many many times, it gives an error. It only happens when I try to filter integer variables.

Unfortunately I still cannot reproduce the error.

  • Do you still get the error after reloading the page?
  • Do you get the error when viewing your notebook in a private/incognito window?
  • Which browser are you using?
  • How exactly are you moving the slider? Could you share a short video?

Thank you very much for checking this. It seems that the error depends on the browser. It shows up in Safari. I just tried Chrome, and no errors. So strange!

But anyway, it would be great if I can change variable type in DuckDB. Currently, I cannot do certain transformation for integer variables in SQL. For example,

SELECT CustomerID * 0.1 as x
FROM foo

will give an error because CustomerID is integer.

I can see the error in Safari, originating in the DuckDB client. Let me share this with the team and get back to you. :pray:

The issue was reported in the DuckDB repo in November: "Maximum call stack size exceeded" errors in Safari · Issue #1058 · duckdb/duckdb-wasm · GitHub

The underlying cause might be a WebKit bug. I’m not sure there’s much that we can do here.

Thank you very much! I will avoid DuckDB and use other databases until it is resolved.