Skip to content

Conversation

@afredojala
Copy link

Summary

  • Fixes an issue where Databricks materialized views with column comments were missing column
    type definitions
  • Databricks requires column types to be explicitly specified in CREATE MATERIALIZED VIEW
    statements when column comments are present

Technical Details

The fix overrides the is_view parameter to False when building column definitions for
materialized views that have column comments. This ensures the base class includes column types
in the schema definition, which Databricks requires for this scenario.

Let me know if we should take do another approach for this.

  Databricks requires column types to be specified when adding column
  comments in CREATE MATERIALIZED VIEW statements. Without the column
  types, the comments are silently ignored.

  This change adds a Databricks-specific override of _build_column_defs
  that forces column types to be included when creating views with column
  descriptions.
   Verifies that column types are included in CREATE MATERIALIZED VIEW
   statements when column comments are present, as required by Databricks.
@CLAassistant
Copy link

CLAassistant commented Nov 5, 2025

CLA assistant check
All committers have signed the CLA.

# in CREATE MATERIALIZED VIEW statements. Override is_view to False to force
# column types to be included when comments are present.
if is_view and column_descriptions:
engine_supports_schema_comments = self.COMMENT_CREATION_VIEW.supports_schema_def
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need this check here provided that we know that this will always be true for Databricks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants