Comments (2)
I hava already submitted a bug to sqlfluff,
Please help to supplement other content
from sqllineage.
This is a parser issue with sqlfluff that we can verify with:
sqlfluff parse test.sql --dialect=tsql
There's only one statement parsed when GROUP BY clause is added:
select id from foo group by id
select * from bar
[L: 1, P: 1] |file:
[L: 1, P: 1] | batch:
[L: 1, P: 1] | statement:
[L: 1, P: 1] | select_statement:
[L: 1, P: 1] | select_clause:
[L: 1, P: 1] | keyword: 'select'
[L: 1, P: 7] | [META] indent:
[L: 1, P: 7] | whitespace: ' '
[L: 1, P: 8] | select_clause_element:
[L: 1, P: 8] | column_reference:
[L: 1, P: 8] | naked_identifier: 'id'
[L: 1, P: 10] | [META] dedent:
[L: 1, P: 10] | whitespace: ' '
[L: 1, P: 11] | from_clause:
[L: 1, P: 11] | keyword: 'from'
[L: 1, P: 15] | whitespace: ' '
[L: 1, P: 16] | from_expression:
[L: 1, P: 16] | [META] indent:
[L: 1, P: 16] | from_expression_element:
[L: 1, P: 16] | table_expression:
[L: 1, P: 16] | table_reference:
[L: 1, P: 16] | naked_identifier: 'foo'
[L: 1, P: 19] | [META] dedent:
[L: 1, P: 19] | whitespace: ' '
[L: 1, P: 20] | groupby_clause:
[L: 1, P: 20] | keyword: 'group'
[L: 1, P: 25] | whitespace: ' '
[L: 1, P: 26] | keyword: 'by'
[L: 1, P: 28] | [META] indent:
[L: 1, P: 28] | whitespace: ' '
[L: 1, P: 29] | column_reference:
[L: 1, P: 29] | naked_identifier: 'id'
[L: 1, P: 31] | whitespace: ' '
[L: 1, P: 32] | newline: '\n'
[L: 2, P: 1] | expression:
[L: 2, P: 1] | select_statement:
[L: 2, P: 1] | select_clause:
[L: 2, P: 1] | keyword: 'select'
[L: 2, P: 7] | [META] indent:
[L: 2, P: 7] | whitespace: ' '
[L: 2, P: 8] | select_clause_element:
[L: 2, P: 8] | wildcard_expression:
[L: 2, P: 8] | wildcard_identifier:
[L: 2, P: 8] | star: '*'
[L: 2, P: 9] | [META] dedent:
[L: 2, P: 9] | whitespace: ' '
[L: 2, P: 10] | from_clause:
[L: 2, P: 10] | keyword: 'from'
[L: 2, P: 14] | whitespace: ' '
[L: 2, P: 15] | from_expression:
[L: 2, P: 15] | [META] indent:
[L: 2, P: 15] | from_expression_element:
[L: 2, P: 15] | table_expression:
[L: 2, P: 15] | table_reference:
[L: 2, P: 15] | naked_identifier: 'bar'
[L: 2, P: 18] | [META] dedent:
[L: 2, P: 18] | [META] dedent:
[L: 2, P: 18] | newline: '\n'
[L: 3, P: 1] | [META] end_of_file:
Whereas removing GROUP BY results in the correct AST with two statements:
select id from foo
select * from bar
[L: 1, P: 1] |file:
[L: 1, P: 1] | batch:
[L: 1, P: 1] | statement:
[L: 1, P: 1] | select_statement:
[L: 1, P: 1] | select_clause:
[L: 1, P: 1] | keyword: 'select'
[L: 1, P: 7] | [META] indent:
[L: 1, P: 7] | whitespace: ' '
[L: 1, P: 8] | select_clause_element:
[L: 1, P: 8] | column_reference:
[L: 1, P: 8] | naked_identifier: 'id'
[L: 1, P: 10] | [META] dedent:
[L: 1, P: 10] | whitespace: ' '
[L: 1, P: 11] | from_clause:
[L: 1, P: 11] | keyword: 'from'
[L: 1, P: 15] | whitespace: ' '
[L: 1, P: 16] | from_expression:
[L: 1, P: 16] | [META] indent:
[L: 1, P: 16] | from_expression_element:
[L: 1, P: 16] | table_expression:
[L: 1, P: 16] | table_reference:
[L: 1, P: 16] | naked_identifier: 'foo'
[L: 1, P: 19] | [META] dedent:
[L: 1, P: 19] | whitespace: ' '
[L: 1, P: 20] | newline: '\n'
[L: 2, P: 1] | statement:
[L: 2, P: 1] | select_statement:
[L: 2, P: 1] | select_clause:
[L: 2, P: 1] | keyword: 'select'
[L: 2, P: 7] | [META] indent:
[L: 2, P: 7] | whitespace: ' '
[L: 2, P: 8] | select_clause_element:
[L: 2, P: 8] | wildcard_expression:
[L: 2, P: 8] | wildcard_identifier:
[L: 2, P: 8] | star: '*'
[L: 2, P: 9] | [META] dedent:
[L: 2, P: 9] | whitespace: ' '
[L: 2, P: 10] | from_clause:
[L: 2, P: 10] | keyword: 'from'
[L: 2, P: 14] | whitespace: ' '
[L: 2, P: 15] | from_expression:
[L: 2, P: 15] | [META] indent:
[L: 2, P: 15] | from_expression_element:
[L: 2, P: 15] | table_expression:
[L: 2, P: 15] | table_reference:
[L: 2, P: 15] | naked_identifier: 'bar'
[L: 2, P: 18] | [META] dedent:
[L: 2, P: 18] | newline: '\n'
[L: 3, P: 1] | [META] end_of_file:
We need to fix it on sqlfluff side.
from sqllineage.
Related Issues (20)
- 请教下当列级血缘和表级血缘在一张图中时是如何处理的? HOT 12
- Tsql -UPDATE set analyz error HOT 1
- Support Hive/SparkSQL Multi Table Insert Syntax HOT 1
- Column level lineage not drawn properly when metadata is provided HOT 1
- [hive] not support insert into table(field1,fleld2.field3) HOT 3
- when I use merge into ,it reports this error HOT 1
- [hive-dialect] order by and union all together it throw error HOT 1
- [hive-dialect]date/time keyword as fieldName with no `` throw error HOT 1
- [hive-dialect] dbName . tableName can not work failed HOT 3
- [hive-dialect] row_number() over (distribute by fund_account sort by bus_date desc) as sort_id ; not support HOT 1
- Will the informix database be supported in the future? HOT 1
- Subquery Partial Wildcard expansion breaks the column lineage path HOT 3
- Greenplum LATERAL Subquery doesn't work HOT 2
- False negative for Scalar Subquery used in Function HOT 2
- "function lineage" HOT 1
- question about column-level lineage: column in group by clause HOT 1
- “SELECT *” can not map real table name, but alias name.
- Installing from source without `npm` HOT 1
- `SQLAlchemy` optional dependency HOT 3
- Qualify Clause Parsing Failure HOT 1
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 sqllineage.