alamb commented on code in PR #12954:
URL: https://github.com/apache/datafusion/pull/12954#discussion_r1803496206


##########
datafusion/sqllogictest/test_files/metadata.slt:
##########
@@ -123,6 +123,19 @@ ORDER BY id, name, l_name;
 NULL bar NULL
 NULL NULL l_bar
 
+# Regression test: missing field metadata from left side of the union when 
right side is chosen

Review Comment:
   I verified that this query fails without the code changes in this PR:
   
   ```sql
   External error: query failed: DataFusion error: Schema error: No field named 
nonnull_name. Valid fields are table_with_metadata.id, 
table_with_metadata.name, table_with_metadata.l_name.
   [SQL] select name from (
     SELECT nonnull_name as name FROM "table_with_metadata"
     UNION ALL
     SELECT NULL::string as name
   ) group by name order by name;
   at test_files/metadata.slt:127
   
   Error: Execution("1 failures")
   error: test failed, to rerun pass `-p datafusion-sqllogictest --test 
sqllogictests`
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to