Giter Club home page Giter Club logo

Comments (1)

taniabogatsch avatar taniabogatsch commented on June 10, 2024

This should be fixed as a side result of #10150. I get the following output on the current main branch.

Error: Binder Error: failed to bind function, either: Invalid LIST argument during lambda function binding!
 or: Referenced column "x" not found in FROM clause!

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 Invalid LIST argument during lambda function binding!. This is the expected error message, as ::JSON AS xs is not a LIST.

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.

from duckdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.