From 2a0200b0477ce5a0c697876b4619484b3caed9d5 Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Thu, 21 Sep 2023 14:28:51 -0700 Subject: [PATCH] feat(ingest): bump acryl-sqlglot (#8882) --- metadata-ingestion/setup.py | 2 +- ...est_select_ambiguous_column_no_schema.json | 31 +++++++++++++++++++ .../unit/sql_parsing/test_sqlglot_lineage.py | 10 ++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 metadata-ingestion/tests/unit/sql_parsing/goldens/test_select_ambiguous_column_no_schema.json diff --git a/metadata-ingestion/setup.py b/metadata-ingestion/setup.py index b916918617..e748461b15 100644 --- a/metadata-ingestion/setup.py +++ b/metadata-ingestion/setup.py @@ -138,7 +138,7 @@ sqllineage_lib = { sqlglot_lib = { # Using an Acryl fork of sqlglot. # https://github.com/tobymao/sqlglot/compare/main...hsheth2:sqlglot:hsheth?expand=1 - "acryl-sqlglot==18.0.2.dev15", + "acryl-sqlglot==18.5.2.dev45", } aws_common = { diff --git a/metadata-ingestion/tests/unit/sql_parsing/goldens/test_select_ambiguous_column_no_schema.json b/metadata-ingestion/tests/unit/sql_parsing/goldens/test_select_ambiguous_column_no_schema.json new file mode 100644 index 0000000000..10f5ee20b0 --- /dev/null +++ b/metadata-ingestion/tests/unit/sql_parsing/goldens/test_select_ambiguous_column_no_schema.json @@ -0,0 +1,31 @@ +{ + "query_type": "SELECT", + "in_tables": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,t1,PROD)", + "urn:li:dataset:(urn:li:dataPlatform:hive,t2,PROD)" + ], + "out_tables": [], + "column_lineage": [ + { + "downstream": { + "table": null, + "column": "a" + }, + "upstreams": [] + }, + { + "downstream": { + "table": null, + "column": "b" + }, + "upstreams": [] + }, + { + "downstream": { + "table": null, + "column": "c" + }, + "upstreams": [] + } + ] +} \ No newline at end of file diff --git a/metadata-ingestion/tests/unit/sql_parsing/test_sqlglot_lineage.py b/metadata-ingestion/tests/unit/sql_parsing/test_sqlglot_lineage.py index 7581d3bac0..483c1ac4cc 100644 --- a/metadata-ingestion/tests/unit/sql_parsing/test_sqlglot_lineage.py +++ b/metadata-ingestion/tests/unit/sql_parsing/test_sqlglot_lineage.py @@ -208,6 +208,16 @@ FROM snowflake_sample_data.tpch_sf100.orders ) +def test_select_ambiguous_column_no_schema(): + assert_sql_result( + """ + select A, B, C from t1 inner join t2 on t1.id = t2.id + """, + dialect="hive", + expected_file=RESOURCE_DIR / "test_select_ambiguous_column_no_schema.json", + ) + + def test_merge_from_union(): # TODO: We don't support merge statements yet, but the union should still get handled.