Comments (3)
Looks like this is a case of >
having a higher precedence than ->
?
This seems to work fine:
SELECT COL FROM TBL WHERE (COL -> '$.K1' -> '$.K2') > 0;
from duckdb.
There is a precedence conflict here, for lambdas we want =
to have higher precedence than ->
:
select list_transform([1,0,2], x -> x=0);
But for JSON we want ->
to have higher precedence than =
:
select (json '{"field": 42}')->'field' = 42;
As such there is no good solution here - so parenthesis are just going to be required here. We'll add a note to the documentation.
from duckdb.
Same issue seems to happen with =
and other operators
eg.
SELECT COL FROM TBL WHERE COL->'$.K1'->'$.K2' = 0;
and
SELECT COL FROM TBL WHERE COL->'$.K1'->'$.K2' is not null;
result in the same error
from duckdb.
Related Issues (20)
- UNPIVOT and COLUMNS(varlist) don't work in a MACRO where varlist is a parameter
- Nested Structs with Many Keys Cast as JSON and Converted to String in Parquet Output HOT 3
- Python UDFs marked as side_effects = False are not having results cached/deduplicated when called from SELECT HOT 6
- DuckDB returns different results on different OS HOT 5
- CSV Buffer not available to reconstruct CSV Line HOT 2
- Attemped it dereference unique_ptr that is null HOT 1
- Incorrect correlation aggregate computation for constant X HOT 3
- Namespace resolution for VIEW does not work for views from ATTACH-ed database HOT 1
- Structured errors and exceptions HOT 2
- Unexpected result after creating index on varchar column HOT 1
- CSV import swallows some lines for large CSVs. HOT 2
- InvalidInputException: Attempting to execute an unsuccessful or closed pending query result HOT 2
- normalize_names does not work properly with `/dev/stdin` HOT 8
- Top-N is much slower than Sort operator
- TransactionContext Error: Failed to commit: DistinctStats called without distinct_stats HOT 1
- Python's `con.table` can deadlock if it triggers other calls to `con` mid-call HOT 5
- "Table with name [...] does not exist" when reading file that exists HOT 4
- Misleading error message when importing JSON with upper/lowercased keys HOT 1
- Unable to download duckdb extension using Github Action HOT 5
- Internal error with unnest and cross join
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckdb.