File tree 5 files changed +16
-41
lines changed
5 files changed +16
-41
lines changed Original file line number Diff line number Diff line change @@ -224,10 +224,7 @@ def _to_src_col(
224
224
if src_col == "*" :
225
225
# select *
226
226
i = 0
227
- if (
228
- SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE
229
- and holder is not None
230
- ):
227
+ if holder is not None :
231
228
for sq in subqueryies :
232
229
columns = holder .get_table_columns (sq )
233
230
if columns :
@@ -241,18 +238,14 @@ def _to_src_col(
241
238
# select unqualified column
242
239
source = _to_src_col (src_col , None )
243
240
is_find = False
244
- if (
245
- SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE
246
- and holder is not None
247
- ):
248
- for sq in subqueryies :
249
- for column in holder .get_table_columns (sq ):
250
- if column .raw_name == src_col :
251
- source = _to_src_col (src_col , sq )
252
- is_find = True
253
- break
254
- if is_find :
241
+ for sq in subqueryies :
242
+ for column in holder .get_table_columns (sq ):
243
+ if column .raw_name == src_col :
244
+ source = _to_src_col (src_col , sq )
245
+ is_find = True
255
246
break
247
+ if is_find :
248
+ break
256
249
if is_find is False :
257
250
setattr (source , "has_qualifier" , False )
258
251
for table in set (alias_mapping .values ()):
Original file line number Diff line number Diff line change @@ -88,11 +88,11 @@ def end_of_query_cleanup(self, holder: SubQueryLineageHolder) -> None:
88
88
lateral_alias_col , tgt_col
89
89
)
90
90
break
91
- if tgt_col .raw_name == "*" :
92
- expand_tgt_col = Column (src_col .raw_name )
93
- expand_tgt_col .parent = tgt_tbl
94
- holder .add_column_lineage (src_col , expand_tgt_col )
95
- continue
91
+ if tgt_col .raw_name == "*" :
92
+ expand_tgt_col = Column (src_col .raw_name )
93
+ expand_tgt_col .parent = tgt_tbl
94
+ holder .add_column_lineage (src_col , expand_tgt_col )
95
+ continue
96
96
if is_lateral_alias_ref :
97
97
continue
98
98
holder .add_column_lineage (src_col , tgt_col )
Original file line number Diff line number Diff line change 4
4
5
5
from sqlfluff .core .parser import BaseSegment
6
6
7
- from sqllineage .config import SQLLineageConfig
8
7
from sqllineage .core .holders import SubQueryLineageHolder
9
8
from sqllineage .core .metadata_provider import MetaDataProvider
10
9
from sqllineage .core .models import Path , SubQuery , Table
@@ -226,11 +225,7 @@ def extract_subquery(
226
225
self .dialect , self .metadata_provider
227
226
).extract (sq .query , AnalyzerContext (cte = holder .cte , write = {sq }))
228
227
229
- if (
230
- SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE
231
- and bool (self .metadata_provider ) is True
232
- ):
233
- subquery_holder .graph .add_node (sq , ** {NodeTag .WRITE : False })
228
+ subquery_holder .graph .add_node (sq , ** {NodeTag .WRITE : False })
234
229
235
230
holder |= subquery_holder
236
231
Original file line number Diff line number Diff line change 1
1
from sqlfluff .core .parser import BaseSegment
2
2
3
- from sqllineage .config import SQLLineageConfig
4
3
from sqllineage .core .holders import SubQueryLineageHolder
5
4
from sqllineage .core .metadata_provider import MetaDataProvider
6
5
from sqllineage .core .parser import SourceHandlerMixin
@@ -57,11 +56,7 @@ def extract(
57
56
for sq in self .list_subquery (seg ):
58
57
subqueries .append (sq )
59
58
60
- if (
61
- SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE
62
- and bool (self .metadata_provider ) is True
63
- ):
64
- self .extract_subquery (subqueries , holder )
59
+ self .extract_subquery (subqueries , holder )
65
60
66
61
for segment in segments :
67
62
self ._handle_swap_partition (segment , holder )
@@ -89,12 +84,6 @@ def extract(
89
84
90
85
self .end_of_query_cleanup (holder )
91
86
92
- if not (
93
- SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE
94
- and bool (self .metadata_provider )
95
- ):
96
- self .extract_subquery (subqueries , holder )
97
-
98
87
holder .expand_wildcard (self .metadata_provider )
99
88
100
89
return holder
Original file line number Diff line number Diff line change 4
4
from sqlfluff .core .parser import BaseSegment
5
5
6
6
from sqllineage import SQLPARSE_DIALECT
7
- from sqllineage .config import SQLLineageConfig
8
7
from sqllineage .core .models import Column , Schema , SubQuery , Table
9
8
from sqllineage .core .parser .sqlfluff .utils import (
10
9
extract_column_qualifier ,
@@ -110,8 +109,7 @@ def of(column: BaseSegment, **kwargs) -> Column:
110
109
alias ,
111
110
source_columns = source_columns ,
112
111
)
113
- if SQLLineageConfig .LATERAL_COLUMN_ALIAS_REFERENCE :
114
- setattr (alias_column , "has_alias" , True )
112
+ setattr (alias_column , "has_alias" , True )
115
113
return alias_column
116
114
if source_columns :
117
115
column_name = None
You can’t perform that action at this time.
0 commit comments