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

Add "what" property for migration to scope down table migrations. #856

Merged
merged 10 commits into from
Jan 30, 2024

Conversation

FastLee
Copy link
Contributor

@FastLee FastLee commented Jan 29, 2024

Changes

Linked issues

related to #333

Resolves #..

Functionality

  • added relevant user documentation
  • added new CLI command
  • modified existing command: databricks labs ucx ...
  • added a new workflow
  • modified existing workflow: ...
  • added a new table
  • modified existing table: ...

Tests

  • manually tested
  • added unit tests
  • added integration tests
  • verified on staging environment (screenshot attached)

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (ee67586) 85.75% compared to head (b861314) 85.85%.

Files Patch % Lines
src/databricks/labs/ucx/hive_metastore/tables.py 91.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
+ Coverage   85.75%   85.85%   +0.10%     
==========================================
  Files          42       42              
  Lines        5369     5394      +25     
  Branches      971      978       +7     
==========================================
+ Hits         4604     4631      +27     
+ Misses        547      546       -1     
+ Partials      218      217       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

keep PR small, let's focus on Scope.

src/databricks/labs/ucx/hive_metastore/tables.py Outdated Show resolved Hide resolved
src/databricks/labs/ucx/hive_metastore/table_migrate.py Outdated Show resolved Hide resolved
src/databricks/labs/ucx/hive_metastore/table_migrate.py Outdated Show resolved Hide resolved
src/databricks/labs/ucx/hive_metastore/table_migrate.py Outdated Show resolved Hide resolved
@FastLee FastLee changed the title Migrate external tables. Automating the migration of external tables. Add "what" property for migration to scope down table migrations. Jan 30, 2024
@FastLee FastLee force-pushed the feature/migrate_ext_table_333 branch from fe5d51b to 17be05d Compare January 30, 2024 14:58
@FastLee FastLee requested a review from nfx January 30, 2024 14:59
@FastLee FastLee marked this pull request as ready for review January 30, 2024 17:32
@FastLee FastLee requested review from a team and priyal-c January 30, 2024 17:32
table_a = Table("a", "b", "c", "MANAGED", "DELTA", location="dbfs:/somelocation/tablename")
assert table_a.is_dbfs_root
assert table_a.what == What.DBFS_ROOT_DELTA
table_b = Table("a", "b", "c", "MANAGED", "PARQUET", location="dbfs:/somelocation/tablename")
Copy link
Contributor

Choose a reason for hiding this comment

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

what about

  1. PARQUET & external?
  2. JSON & external?
  3. CSV & external?
  4. TEXT & external?
  5. avro (whatever other formats) & external?
  6. what about the same formats & DBFS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

External tables are divided to supported and unsupported.
All the unsupported are marked "unknown"
It may be a good idea to introduce EXTERNAL_SYNC and EXTERNAL_NO_SYNC or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to replace the table_format I want the field to highlight what kind of table it is when it comes to migration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added EXTERNAL_SYNC and EXTERNAL_NO_SYNC to correspond to the supported/unsupported formats.

tests/unit/hive_metastore/test_tables.py Outdated Show resolved Hide resolved
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

lgtm

@nfx nfx merged commit fedf569 into main Jan 30, 2024
7 checks passed
@nfx nfx deleted the feature/migrate_ext_table_333 branch January 30, 2024 23:45
nfx added a commit that referenced this pull request Feb 1, 2024
* Added "what" property for migration to scope down table migrations ([#856](#856)).
* Added job count in the assessment dashboard ([#858](#858)).
* Adopted `installation` package from `databricks-labs-blueprint` ([#860](#860)).
* Debug logs to print only the first 96 bytes of SQL query by default, tunable by `debug_truncate_bytes` SDK configuration property ([#859](#859)).
* Extract command codes and unify the checks for spark_conf, cluster_policy, init_scripts ([#855](#855)).
* Improved installation failure with actionable message ([#840](#840)).
* Improved validating groups membership cli command ([#816](#816)).

Dependency updates:

 * Updated databricks-labs-blueprint requirement from ~=0.1.0 to ~=0.2.4 ([#867](#867)).
@nfx nfx mentioned this pull request Feb 1, 2024
nfx added a commit that referenced this pull request Feb 1, 2024
* Added "what" property for migration to scope down table migrations
([#856](#856)).
* Added job count in the assessment dashboard
([#858](#858)).
* Adopted `installation` package from `databricks-labs-blueprint`
([#860](#860)).
* Debug logs to print only the first 96 bytes of SQL query by default,
tunable by `debug_truncate_bytes` SDK configuration property
([#859](#859)).
* Extract command codes and unify the checks for spark_conf,
cluster_policy, init_scripts
([#855](#855)).
* Improved installation failure with actionable message
([#840](#840)).
* Improved validating groups membership cli command
([#816](#816)).

Dependency updates:

* Updated databricks-labs-blueprint requirement from ~=0.1.0 to ~=0.2.4
([#867](#867)).
dmoore247 pushed a commit that referenced this pull request Mar 23, 2024
)

## Changes
<!-- Summary of your changes that are easy to understand. Add
screenshots when necessary -->

### Linked issues
related to  #333 

Resolves #..

### Functionality 

- [ ] added relevant user documentation
- [ ] added new CLI command
- [ ] modified existing command: `databricks labs ucx ...`
- [ ] added a new workflow
- [ ] modified existing workflow: `...`
- [ ] added a new table
- [ ] modified existing table: `...`

### Tests
<!-- How is this tested? Please see the checklist below and also
describe any other relevant tests -->

- [ ] manually tested
- [ ] added unit tests
- [ ] added integration tests
- [ ] verified on staging environment (screenshot attached)
dmoore247 pushed a commit that referenced this pull request Mar 23, 2024
* Added "what" property for migration to scope down table migrations
([#856](#856)).
* Added job count in the assessment dashboard
([#858](#858)).
* Adopted `installation` package from `databricks-labs-blueprint`
([#860](#860)).
* Debug logs to print only the first 96 bytes of SQL query by default,
tunable by `debug_truncate_bytes` SDK configuration property
([#859](#859)).
* Extract command codes and unify the checks for spark_conf,
cluster_policy, init_scripts
([#855](#855)).
* Improved installation failure with actionable message
([#840](#840)).
* Improved validating groups membership cli command
([#816](#816)).

Dependency updates:

* Updated databricks-labs-blueprint requirement from ~=0.1.0 to ~=0.2.4
([#867](#867)).
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.

2 participants