Querying Semistructured Data with Column Elements
See original GitHub issuePlease answer these questions before submitting your issue. Thanks!
-
What version of Python are you using (
python --version
)? 3.6.5 -
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)? Darwin-16.7.0-x86_64-i386-64bit -
Question: My question is how do I use semistructured data in my sqlalchemy orm queries. I am interested in referencing the semistructured data in the SELECT, JOINs and the WHERE clause.
I would like to generate a query like this with snowflake-sqlalchemy, however I’m not sure how to generate the snowflake semistructured data syntax table.column_name:key
:
SELECT activity.blob:document_id
FROM event
JOIN event ON activity.blob:event_id == event.id
WHERE activity.blob:document_id > 5
Thank you for your help, Alana
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Querying Semi-structured Data - Snowflake Documentation
This topic explains how to use special operators and functions to query complex hierarchical data stored in a VARIANT.
Read more >Querying Snowflake Semi-Structured Data: 2 Critical Aspects
This page details how to query Snowflake Semi-structured data. It also details how you can cast data types and then use the LATERAL...
Read more >Querying semistructured data - Amazon Redshift
In Amazon Redshift, you can work with the PartiQL language for SQL-compatible access to semistructured data.
Read more >Query semi-structured data in Databricks
Create a table with highly nested data; Extract a top-level column; Extract nested fields; Extract values from arrays; Cast values; NULL ...
Read more >Query semi-structured data in Azure Databricks - Microsoft Learn
You specify nested fields through dot notation or using brackets. When you use brackets, columns are matched case sensitively. SQL Copy.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
JSON
column type as it works in PostgreSQL would allow writing the query aswhich is a significant improvement
Here is a possible solution, but it seems a little hacky and verbose
.op(':')(text('key'))
: