datafusion
datafusion copied to clipboard
feat: Enforce the uniqueness of map key name for the map/make_map function
Which issue does this PR close?
Closes #11437
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?
Thanks @Weijun-H overall LGTM. I also tested some cases for nested type as the key. They work well. 👍
# Test duplicate keys query error DataFusion error: Execution error: map key must be unique, duplicate key found: \[1, 2\] SELECT MAP([[1,2], [1,2], []], [41, 33, null]); # Test duplicate keys query error DataFusion error: Execution error: map key must be unique, duplicate key found: \[\{1:1\}\] SELECT MAP([Map {1:'1'}, Map {1:'1'}, Map {2:'2'}], [41, 33, null]);
Nice catch! I added them to the tests
I plan to review this today
@jayzhan211 do you have some time to review this pr?
Thank you @dharanad @goldmedal @jayzhan211