dharanad commented on code in PR #11614:
URL: https://github.com/apache/datafusion/pull/11614#discussion_r1688674635


##########
datafusion/functions/src/core/named_struct.rs:
##########
@@ -57,6 +57,15 @@ fn named_struct_expr(args: &[ColumnarValue]) -> 
Result<ColumnarValue> {
         .into_iter()
         .unzip();
 
+    // Check to enforce the uniqueness of struct field name
+    let unique_field_names_set = names.iter().collect::<HashSet<_>>();
+
+    if unique_field_names_set.len() != names.len() {
+        return exec_err!("named_struct requires unique field names");

Review Comment:
   That's a great idea @alamb . Thank You. I will make the changes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to