Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #836 +/- ##
==========================================
+ Coverage 85.61% 85.66% +0.05%
==========================================
Files 41 42 +1
Lines 5212 5232 +20
Branches 950 953 +3
==========================================
+ Hits 4462 4482 +20
Misses 536 536
Partials 214 214 ☔ View full report in Codecov by Sentry. |
dmoore247
left a comment
There was a problem hiding this comment.
Amazing work!
Please consider testing unicode, kanji (Multi-language support, and embedded space chars).
| assert "`a-b`.`c`.`d`" == cb.escape("a-b.c.d", False) | ||
| assert "`a`.`b-c`.`d`" == cb.escape("a.b-c.d", False) | ||
| assert "`a`.`b`.`c-d`" == cb.escape("a.b.c-d", False) | ||
|
|
There was a problem hiding this comment.
Amazing!!!
Please consider testing unicode, kanji, embedded space characters.
This documentation isn't much help... https://docs.databricks.com/en/sql/language-manual/sql-ref-names.html#names
| """ | ||
| return f"{self._catalog}.{self._schema}.{self._table}" | ||
|
|
||
| @staticmethod |
There was a problem hiding this comment.
create a function of it and call it escape_sql_identifier, it doesn't really belong to this class, as it turns out from number of CrawlerBase. prefixes
There was a problem hiding this comment.
Yeah, that makes sense, I was about to ask that. Where do we put functions? A new Python source in the root of the project? Or some utils subdir?
|
I have a pattern like this: |
How would you handle this: |
5f3c84a to
7ecd12a
Compare
Thanks. The patterns I'm working with only has dots in the table name, although I think we can escape all of them (maybe not in the test, but in the actual code). It's true that DB does not allow for dots, but other catalogs do; I'm facing this issue as I'm crawling an external hive metastore which allows for dots. Thank you! |
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
Changes
Implements handling of special characters in SQL names. Optionally escapes the catalog, schema, or table names with backticks for SQL queries.
Linked issues
Resolves #833
Tests