-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Misleading binder error #10412
Comments
This should be fixed as a side result of #10150. I get the following output on the current
Basically, we try to bind this query twice, and both attempts fail. The error message now includes the failure-reason of the first attempt, which is tania@motorbook duckdb % build/release/duckdb
v0.9.3-dev3936 b92cb1ae39
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D SELECT '[{"x":1}]'::JSON AS xs, list_transform(xs, x -> x);
Error: Binder Error: failed to bind function, either: Invalid LIST argument during lambda function binding!
or: Referenced column "x" not found in FROM clause!
D SELECT '[{"x":1}]'::JSON;
┌─────────────────────────────┐
│ CAST('[{"x":1}]' AS "JSON") │
│ json │
├─────────────────────────────┤
│ [{"x":1}] │
└─────────────────────────────┘
D SELECT '[{"x":1}]'::JSON AS xs, list_transform(xs::JSON[], x -> x);
┌───────────┬────────────────────────────────────────────────┐
│ xs │ list_transform(CAST(xs AS "JSON"[]), (x -> x)) │
│ json │ json[] │
├───────────┼────────────────────────────────────────────────┤
│ [{"x":1}] │ [{"x":1}] │
└───────────┴────────────────────────────────────────────────┘
D SELECT '[{"x":1}]'::JSON[] AS xs, list_transform(xs, x -> x);
┌───────────┬──────────────────────────────┐
│ xs │ list_transform(xs, (x -> x)) │
│ json[] │ json[] │
├───────────┼──────────────────────────────┤
│ [{"x":1}] │ [{"x":1}] │
└───────────┴──────────────────────────────┘ I am closing this, as it has already been fixed. |
What happens?
A query like
fails with an error
BinderException: Binder Error: Referenced column "x" not found in FROM clause!
, but the error doesn't involve thex
as correcting the cast (tojson[]
rather than justjson
) removes the exception.To Reproduce
OS:
windows x64
DuckDB Version:
duckdb-0.9.2-cp37-cp37m-win_amd64
DuckDB Client:
Python
Full Name:
eaubin
Affiliation:
n/a
Have you tried this on the latest
main
branch?I have tested with a release build (and could not test 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?
The text was updated successfully, but these errors were encountered: