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

Fix/nullable joins #1486

Closed
wants to merge 3 commits into from
Closed

Fix/nullable joins #1486

wants to merge 3 commits into from

Conversation

sbres
Copy link
Contributor

@sbres sbres commented Mar 15, 2022

This PR should fix #1334 and #1349

Columns with star reference were lacking the TableAlias attribute. Now it's set to t.Rel.Name like in expand()

  • TODO Create tests with star reference

- The lack of this field creates an issue for queries using wildcard for select.
When comparing `*n.Alias.Aliasname == col.TableAlias` isTableRequired would always return not found
This where breaking before, like this there is am example for make test-endtoend to detect
@sbres
Copy link
Contributor Author

sbres commented Mar 16, 2022

Depends on #1488 for test to run properly

Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

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

You sadly have a set of merge conflicts now. Can you re-request a review from me when things are mergeable?

Comment on lines -19 to -22
if n, ok := item.(*ast.String); ok {
items = append(items, n.Str)
continue
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain why this needs to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you look at the full function the condition is there twice.
I was tidying a little bit the code, it does not impact anything.

func stringSlice(list *ast.List) []string {
	items := []string{}
	for _, item := range list.Items {
		if n, ok := item.(*ast.String); ok {
			items = append(items, n.Str)
			continue
		}
		if n, ok := item.(*ast.String); ok {
			items = append(items, n.Str)
			continue
		}

@sbres
Copy link
Contributor Author

sbres commented Mar 19, 2022

Maybe we should just close this PR as #1491 already fixes the same thing and was merged right away

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.

Left Join not generating correct Null* Types
2 participants