Cartesian product exception with ANSI-89 Syntax
See original GitHub issuewhen i use LineageRunner to analyze a sql string like "select a.* from table a,table b " it throws a SQLLineageException: SQLLineageException: An Identifier is expected, got IdentifierList[value: a, table] instead So how can i deal with that exception?
from sqllineage.runner import * LineageRunner("select a.* from table1 a, table2 b").target_tables
`--------------------------------------------------------------------------- SQLLineageException Traceback (most recent call last) <ipython-input-102-0715be0fec21> in <module>() ----> 1 LineageRunner(“select a.* from table1 a, table2 b”).target_tables
~/anaconda3/lib/python3.6/site-packages/sqllineage/runner.py in init(self, sql, encoding, verbose) 31 if s.token_first(skip_cm=True) 32 ] —> 33 self._lineage_results = [LineageAnalyzer().analyze(stmt) for stmt in self._stmt] 34 self._combined_lineage_result = combine(*self._lineage_results) 35 self._verbose = verbose
~/anaconda3/lib/python3.6/site-packages/sqllineage/runner.py in <listcomp>(.0) 31 if s.token_first(skip_cm=True) 32 ] —> 33 self._lineage_results = [LineageAnalyzer().analyze(stmt) for stmt in self._stmt] 34 self._combined_lineage_result = combine(*self._lineage_results) 35 self._verbose = verbose
~/anaconda3/lib/python3.6/site-packages/sqllineage/core.py in analyze(self, stmt) 91 else: 92 # DML parsing logic also applies to CREATE DDL —> 93 self._extract_from_DML(stmt) 94 return self._lineage_result 95
~/anaconda3/lib/python3.6/site-packages/sqllineage/core.py in _extract_from_DML(self, token) 143 raise SQLLineageException( 144 “An Identifier is expected, got %s[value: %s] instead” –> 145 % (type(sub_token).name, sub_token) 146 ) 147 source_table_token_flag = False
SQLLineageException: An Identifier is expected, got IdentifierList[value: table1 a, table2 b] instead`
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hi @coldmoutain , to do a cartesian join in ANSI-92 standard SQL, it’s more like
or simply join without on condition
As for the syntax you’re using, I look it up a little bit. It seems this is ANSI-89 standard. See https://stackoverflow.com/questions/334201/why-isnt-sql-ansi-92-standard-better-adopted-over-ansi-89 for reference.
Personally I’ve never seen it before. Would you mind tell me which SQL dialect you are using? Is it Oracle?
thx!