You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
As soon as dialect-based parsing use sqlfluff to parse SQL it will be great to support sqlfluff context (from .sqlfluff files) where we can use/set templater and other options
Describe the solution you'd like
sqlfluff.core.linter.Linter have optional config: FluffConfig parameter. Need to pass it or ensure that default is used
Additional context
dmytro.kulyk@MAC-570022 datalake % sqllineage -f transform/airflow/dags/queries/aws_transforms/aggregate/pokermatch_payment.partitions_range.sql
Traceback (most recent call last):
File "/opt/homebrew/bin/sqllineage", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/sqllineage/cli.py", line 125, in main
runner.print_table_lineage()
File "/opt/homebrew/lib/python3.11/site-packages/sqllineage/runner.py", line 175, in print_table_lineage
print(str(self))
^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/sqllineage/runner.py", line 26, in wrapper
self._eval()
File "/opt/homebrew/lib/python3.11/site-packages/sqllineage/runner.py", line 195, in _eval
stmt_holder = analyzer.analyze(stmt, session.metadata_provider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/sqllineage/core/parser/sqlfluff/analyzer.py", line 48, in analyze
raise UnsupportedStatementException(
sqllineage.exceptions.UnsupportedStatementException: SQLLineage cannot parse SQL:{%- set task_id = 'ph2_transaction.data_processing' %}
{%- set transaction_date = ti.xcom_pull(task_ids=task_id, key='new_partitions') %}
{%if transaction_date|length >0%}
select
row_num,
min(as_of_date) as start_date,
max(as_of_date) as end_date,
array_agg(as_of_date) as dates
from (
select
...
It makes sense to be support analyzing templated SQL so lineage can analyzed based on what's in orchestration system instead of merely on SQL logs.
Quick question: do you require any configuration in sqlfluff other than templating? Because supports all sqlfluff configuration looks like a overkill for me.
Is your feature request related to a problem? Please describe
As soon as dialect-based parsing use
sqlfluff
to parse SQL it will be great to support sqlfluff context (from.sqlfluff
files) where we can use/set templater and other optionsDescribe the solution you'd like
sqlfluff.core.linter.Linter
have optionalconfig: FluffConfig
parameter. Need to pass it or ensure that default is usedAdditional context
running
sqlfluff
directly:.sqlfluff
exampleThe text was updated successfully, but these errors were encountered: