snowpark-python
snowpark-python copied to clipboard
SNOW-1373887: [Local Testing] enable diamond shaped joins
-
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1373887
-
Fill out the following pre-review checklist:
- [ ] I am adding a new automated test(s) to verify correctness of my new code
- [ ] If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
- [ ] I am adding new logging messages
- [ ] I am adding a new telemetry message
- [ ] I am adding new credentials
- [ ] I am adding a new dependency
- [ ] If this is a new feature/behavior, I'm adding the Local Testing parity changes.
- [ ] I am adding a new automated test(s) to verify correctness of my new code
-
Please describe how your code solves the related issue.
This bug had two component issues:
- Join plans dropped column aliases when joined columns shared uuids. In theory columns with the same uuid are the same column so it should be ok to just favor one side or the other of the join when these conflicts occur. I've chosen the left side, but I think it's arbitrary.
- When trying to flatten a select query the would check if the pre-flatten dataframe could support a new column lookup rather than the post-flatten dataframe. I've changed it to look at the new post-flatten so that flattening is disabled when this would lose information.