Skip to content

Spark: Add more tests for action alignment in MERGE#2185

Merged
aokolnychyi merged 2 commits intoapache:masterfrom
aokolnychyi:more-merge-tests
Jan 29, 2021
Merged

Spark: Add more tests for action alignment in MERGE#2185
aokolnychyi merged 2 commits intoapache:masterfrom
aokolnychyi:more-merge-tests

Conversation

@aokolnychyi
Copy link
Contributor

This PR adds more tests for AssignmentAlignmentSupport that previously required an actual implementation of MERGE.

@github-actions github-actions bot added the spark label Jan 29, 2021
}

// TODO: tests for reordering when operations succeed (both insert and update actions)
// TODO: tests for subqueries in conditions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Subqueries were addressed earlier in this file.

@aokolnychyi
Copy link
Contributor Author

cc @dilipbiswal @rdblue

sql("MERGE INTO %s t USING source " +
"ON t.id == source.id " +
"WHEN MATCHED THEN " +
" UPDATE SET t.s = named_struct('c1', 100, 'c2', named_struct('a', array(1), 'm', map('x', 'y')))", tableName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a negative case for when the names are out of order or do not match?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we already have a bunch of negative tests in this file below. For example, this point should be already covered by testMergeWithInvalidAssignments. Could you double-check if that's what you meant?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. Looks good.

@aokolnychyi aokolnychyi merged commit 6ff9539 into apache:master Jan 29, 2021
@aokolnychyi
Copy link
Contributor Author

Thanks for reviewing, @rdblue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments