terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

Added support for popular column types for `resource_sql_table`

Open tanmay-db opened this issue 1 year ago • 2 comments

Changes

Added support for:

  1. Mapping of integer -> int and long -> bigint
  2. Case insensitive column types
  3. Suppress diffs for column types

We might need other types of mapping as well but for now this seems sufficient according to the issue raised internally and https://github.com/databricks/terraform-provider-databricks/issues/3490

Note: Since the PR also adds case sensitive matching, it includes functionality from: https://github.com/databricks/terraform-provider-databricks/pull/3501. I have followed up with author to rebase and their unit test can be added here: https://github.com/databricks/terraform-provider-databricks/pull/3501#issuecomment-2088379422

Tests

Added integration test, before changes it fails during assertNoColumnTypeDiff because of using "integer" and after that also due to no suppress diff: image

  • [ ] make test run locally
  • [ ] relevant change in docs/ folder
  • [ ] covered with integration tests in internal/acceptance
  • [ ] relevant acceptance tests are passing
  • [ ] using Go SDK

tanmay-db avatar May 01 '24 11:05 tanmay-db

long to bigint mapping works E2E in integration test and also another user mentions it here: https://github.com/databricks/terraform-provider-databricks/issues/3490#issuecomment-2066330433 but couldn't find this information in API docs.

tanmay-db avatar May 01 '24 12:05 tanmay-db

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.33%. Comparing base (9648502) to head (6e6ad07).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3528      +/-   ##
==========================================
- Coverage   82.34%   82.33%   -0.01%     
==========================================
  Files         190      190              
  Lines       19312    19319       +7     
==========================================
+ Hits        15902    15907       +5     
- Misses       2479     2480       +1     
- Partials      931      932       +1     
Files Coverage Δ
catalog/resource_sql_table.go 88.72% <77.77%> (-0.31%) :arrow_down:

codecov-commenter avatar May 01 '24 12:05 codecov-commenter