diff --git a/sqllineage/__init__.py b/sqllineage/__init__.py index f7d35854..bef62ffe 100644 --- a/sqllineage/__init__.py +++ b/sqllineage/__init__.py @@ -2,7 +2,7 @@ NAME = "openmetadata-sqllineage" -VERSION = "1.0.4" +VERSION = "1.1.0.0" DEFAULT_LOGGING = { "version": 1, "disable_existing_loggers": False, diff --git a/sqllineage/core/parser/sqlfluff/extractors/dml_insert_extractor.py b/sqllineage/core/parser/sqlfluff/extractors/dml_insert_extractor.py index 4e7700b9..7ca9239a 100644 --- a/sqllineage/core/parser/sqlfluff/extractors/dml_insert_extractor.py +++ b/sqllineage/core/parser/sqlfluff/extractors/dml_insert_extractor.py @@ -22,6 +22,7 @@ class DmlInsertExtractor(LineageHolderExtractor): SUPPORTED_STMT_TYPES = [ "insert_statement", "create_table_statement", + "create_table_as_statement", "create_view_statement", "update_statement", "copy_statement", diff --git a/sqllineage/core/parser/sqlfluff/models.py b/sqllineage/core/parser/sqlfluff/models.py index 4d353cfb..eaaaf063 100644 --- a/sqllineage/core/parser/sqlfluff/models.py +++ b/sqllineage/core/parser/sqlfluff/models.py @@ -185,7 +185,9 @@ def _get_column_from_subquery( ).get_column_lineage(exclude_subquery=False) ] source_columns = [ - ColumnQualifierTuple(src_col.raw_name, src_col.parent.raw_name) + ColumnQualifierTuple( + src_col.raw_name, src_col.parent.raw_name if src_col.parent else None + ) for src_col in src_cols ] return source_columns diff --git a/sqllineage/core/parser/sqlparse/models.py b/sqllineage/core/parser/sqlparse/models.py index 7a78dbc3..6499773a 100644 --- a/sqllineage/core/parser/sqlparse/models.py +++ b/sqllineage/core/parser/sqlparse/models.py @@ -116,7 +116,10 @@ def _extract_source_columns(token: Token) -> List[ColumnQualifierTuple]: ) ] source_columns = [ - ColumnQualifierTuple(src_col.raw_name, src_col.parent.raw_name) + ColumnQualifierTuple( + src_col.raw_name, + src_col.parent.raw_name if src_col.parent else None, + ) for src_col in src_cols ] else: