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

[BUG]: View migration fails to resolve/include aliases in view create resulting in column does not exist #2661

Closed
1 task done
pritishpai opened this issue Sep 17, 2024 · 3 comments · Fixed by #2726
Closed
1 task done
Labels
bug Something isn't working cloud/aws Issues related to AWS feat/migration-progress Issues related to the migration progress workflow migrate/views

Comments

@pritishpai
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

No response

Expected Behavior

Views should be migrated successfully

Steps To Reproduce

Failed in the customer environment where the view depends on tables that are referred with alias in the the CREATE VIEW.

Cloud

AWS

Operating System

Windows

Version

latest via Databricks CLI

Relevant log output

No response

@pritishpai pritishpai added bug Something isn't working cloud/aws Issues related to AWS migrate/views feat/migration-progress Issues related to the migration progress workflow labels Sep 17, 2024
@pritishpai pritishpai self-assigned this Sep 17, 2024
@pritishpai
Copy link
Contributor Author

sqlglot does not seem to be resolving aliases correctly

@pritishpai pritishpai removed their assignment Sep 20, 2024
@JCZuurmond
Copy link
Member

@pritishpai : Could you include a query for which this is failing?

@pritishpai
Copy link
Contributor Author

I added a simple alias query and an integration test while I was debugging the issue.
https://github.com/databrickslabs/ucx/blob/fix/issue_2661/tests/integration/hive_metastore/test_migrate.py#L352

@nfx nfx closed this as completed in #2726 Sep 25, 2024
@nfx nfx closed this as completed in bb696d3 Sep 25, 2024
jgarciaf106 pushed a commit to rportilla-databricks/ucx that referenced this issue Sep 26, 2024
…kslabs#2726)

## Changes
The alias for the source table is disappearing while converting the
create view sql from legacy hive metastore to uc catalog.

### Linked issues
Resolves databrickslabs#2661 

### Functionality

- [x] fixes sql conversion

### Tests
- [x] manually tested
- [x] added unit tests
- [ ] added integration tests
- [ ] verified on staging environment (screenshot attached)

---------

Co-authored-by: Liran Bareket <liran.bareket@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cloud/aws Issues related to AWS feat/migration-progress Issues related to the migration progress workflow migrate/views
Projects
Development

Successfully merging a pull request may close this issue.

2 participants