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

Table migration mapping #525

Closed
wants to merge 2 commits into from
Closed

Table migration mapping #525

wants to merge 2 commits into from

Conversation

FastLee
Copy link
Contributor

@FastLee FastLee commented Oct 30, 2023

Closes #304

@FastLee FastLee marked this pull request as ready for review October 31, 2023 13:45
@FastLee FastLee requested a review from a team October 31, 2023 13:45
if re.match(r"^\w+$", default_catalog):
break
else:
print(f"{default_catalog} is not a valid catalog name")
Copy link
Contributor

Choose a reason for hiding this comment

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

Make a logger.warn instead and provide a hint for what's a "valid catalog name"

mapping = "element,target,notes\n"
mapping += f"<root>,{default_catalog},Default Mapping created by UCX Install\n"
path = f"{self._install_folder}/table_upgrade_map.csv"
self._ws.workspace.upload(path, mapping.encode("utf8"), format=ImportFormat.AUTO, overwrite=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some test to validate that we've indeed saved the catalog name

@@ -778,6 +799,11 @@ def _get_ext_hms_conf_from_policy(cluster_policy):
spark_conf_dict[key[11:]] = cluster_policy[key]["value"]
return instance_profile, spark_conf_dict

def _write_mapping_conf_file(self, default_catalog: str):
mapping = "element,target,notes\n"
mapping += f"<root>,{default_catalog},Default Mapping created by UCX Install\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand the scope of this PR, why would we write a mapping file when the user can only enter the default catalog name ?

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2023

CLA assistant check
All committers have signed the CLA.

@nfx nfx closed this Dec 6, 2023
@nfx nfx deleted the feature/table_mapping branch December 6, 2023 16:06
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.

Create mapping document from HMS tables to UC tables.
4 participants