Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAT-19308 - feat(databricks): ensure essential table properties Delta.* #233

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

CharlesQueiroz
Copy link
Contributor

Overview

This PR addresses the handling of essential Delta table properties in the Databricks extension, specifically ensuring critical properties are always included in table creation statements regardless of user input.

Problem

Previously, when users specified custom TBLPROPERTIES during table creation, the system would not guarantee the presence of essential Delta properties.

Solution

The implementation introduces a property management system that:

  1. Defines a set of essential Delta properties that must always be present
  2. Provides default values for these properties
  3. Implements property merging logic that:
    • Preserves user-specified values for essential properties when provided
    • Automatically adds missing essential properties with default values
    • Maintains any additional custom properties specified by users

Key Changes

  • Created constants for essential properties and their default values
  • Implemented property processing logic in processTableProperties method
  • Added test coverage for various property combinations
  • Ensured backward compatibility with existing table creation workflows

Testing

The changes are covered by unit tests that verify:

  • Default property inclusion
  • Custom property preservation
  • Mixed property scenarios
  • Various value types (strings, numbers, booleans)
  • Edge cases with empty or null properties

Copy link
Contributor

@SvampX SvampX left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Had a concern about wrapping of properties key/value in quotes, but acccording to tests logic uses existing user specified approach and default values are wrapped.

Copy link
Contributor

@SvampX SvampX left a comment

Choose a reason for hiding this comment

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

@CharlesQueiroz we need to update expected SQL-s, see failed harness tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants