diff --git a/dbt/include/databricks/macros/relations/streaming_table/create.sql b/dbt/include/databricks/macros/relations/streaming_table/create.sql index cadc68d1d..17d5ac7bc 100644 --- a/dbt/include/databricks/macros/relations/streaming_table/create.sql +++ b/dbt/include/databricks/macros/relations/streaming_table/create.sql @@ -9,26 +9,7 @@ {%- set comment = streaming_table.config["comment"].comment -%} {%- set refresh = streaming_table.config["refresh"] -%} - {%- set analysis_sql = sql | replace('STREAM ', '') | replace('stream ', '') -%} - - {# - TODO: When DESCRIBE QUERY EXTENDED is supported, this implementation should be simplified - to use that instead. For now, we work around this limitation by writing results to a - temporary view and using DESCRIBE TABLE EXTENDED on the temporary view. - #} - {%- set temp_relation = make_temp_relation(relation) -%} - {% call statement('create_temp_view') -%} - {%- set view_sql = analysis_sql.rstrip('; \n\t') -%} - {{ create_temporary_view(temp_relation, view_sql) }} - {%- endcall %} - - {%- set columns = adapter.get_columns_in_relation(temp_relation) -%} - {%- set model_columns = model.get('columns', {}) -%} - {%- set columns_and_constraints = adapter.parse_columns_and_constraints(columns, model_columns, []) -%} - - {#-- We don't enrich the relation with model constraints because they are not supported for streaming tables --#} CREATE STREAMING TABLE {{ relation.render() }} - {{ get_column_and_constraints_sql(relation, columns_and_constraints[0]) }} {{ get_create_sql_partition_by(partition_by) }} {{ liquid_clustered_cols() }} {{ get_create_sql_comment(comment) }}