Comments (7)
this is not too difficult, just need to support single semicolon, if you want to take a stab at this, i can walk you through what needs to be done. can do a vid call or some kind of chat app to sync if you're interested.
i'm not familiar with snowflake, but is x:y just JSON_PATH(x, y) or STRUCT_EXTRACT?, seems more similar to struct_extract...
from sqlglot.
@danfrankj i'm reading through snowflake docs and i don't quite understand the difference between : and .
can i just convert : -> .? this is a one line change
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index 117b0c9..7edb4a8 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -1103,7 +1103,7 @@ class Parser:
this = self.expression(exp.Column, this=this)
this = self._parse_bracket(this)
- while self._match(TokenType.DOT):
+ while self._match_set({TokenType.DOT, TokenType.COLON}):
field = self._parse_id_var() or self._parse_star()
if isinstance(this, exp.Column) and not this.table:
this = self.expression(exp.Column, this=field, table=this.this)
from sqlglot.
@tobymao I know this is closed, but I'm hitting the same issue currently with version 10.5.10. Happy to provide more information and/or to open a new issue for this. Below is a screenshot of the issue - I imagine it's because there are double quotes, since that is what seems to differ between my example and the example provided by @danfrankj
from sqlglot.
please open a new issue thanks!
from sqlglot.
@NodeJSmith i tried to recreate your error from your screen shot but it seems to work
python -m sqlglot 'select generated_features:"uws.rcu"' --read=snowflake
SELECT
"generated_features"['uws.rcu']
from sqlglot.
don't forget to pass the read dialect in as snowflake
from sqlglot.
@tobymao fudge, I totally forgot to do that 🤦♀️ I'll try it today, I imagine that will fix it. Sorry for the false alarm
from sqlglot.
Related Issues (20)
- extract SQL query keywords from a sql query HOT 1
- support "replace into" HOT 1
- APPROX_PERCENTILE is translated from Trino to APPROX_QUANTILE in Snowflake, which does not exist in Snowflake
- Missing tokens for Oracle datatypes. HOT 1
- Incorrect transpiling of MOD function from trino to snowflake
- Unable to parse Trino WITH FUNCTION clause HOT 4
- Incorrect generation of string concatenation to postgres HOT 1
- Parsing issue for Snowflake COPY INTO queries with subqueries
- Allow comma-separated values for `CREATE SEQUENCE` properties (Snowflake)
- Expanding diff to compare 2 SQL documents HOT 4
- Expression .sql() function preserve comments when comments=False.
- expression.AlterTable doesn't seem to support dropping columns HOT 4
- Oracle to Spark SQL. Failure to unnest queries during optimisation
- Incorrect generating of SHA expression to bigquery dialect
- Incorrect parsing and generating of SHA, SHA2, MD5, and MD5_Digest expressions in clickhouse dialect
- Trino/Presto dialect regression/change starting in 23.11.0? (table identifier quoted attribute ignored) HOT 2
- Rendering of `TABLESAMPLE` yields invalid `PERCENT` keyword for Postgres dialect HOT 2
- Incorrect parsing and generating of SHA, SHA2, MD5, and MD5_Digest expressions in Presto/Trino dialect
- Behavior of HEX function is different between dialects HOT 3
- sqlglot parsing error for specific SQL query HOT 2
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 sqlglot.