pepijnve commented on code in PR #17884:
URL: https://github.com/apache/datafusion/pull/17884#discussion_r2399038530


##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -1453,31 +1464,31 @@ mod tests {
         let sql_string = fmt_sql(expr.as_ref()).to_string();
         let display_string = expr.to_string();
         assert_eq!(sql_string, "a IN (a, b)");
-        assert_eq!(display_string, "Use a@0 IN (SET) ([Literal { value: 
Utf8(\"a\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(\"b\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }])");
+        assert_eq!(display_string, "a@0 IN (SET) ([a, b])");
 
         // Test: a NOT IN ('a', 'b')
         let list = vec![lit("a"), lit("b")];
         let expr = in_list(Arc::clone(&col_a), list, &true, &schema)?;
         let sql_string = fmt_sql(expr.as_ref()).to_string();
         let display_string = expr.to_string();
         assert_eq!(sql_string, "a NOT IN (a, b)");
-        assert_eq!(display_string, "a@0 NOT IN (SET) ([Literal { value: 
Utf8(\"a\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(\"b\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }])");
+        assert_eq!(display_string, "a@0 NOT IN (SET) ([a, b])");
 
         // Test: a IN ('a', 'b', NULL)
         let list = vec![lit("a"), lit("b"), lit(ScalarValue::Utf8(None))];
         let expr = in_list(Arc::clone(&col_a), list, &false, &schema)?;
         let sql_string = fmt_sql(expr.as_ref()).to_string();
         let display_string = expr.to_string();
         assert_eq!(sql_string, "a IN (a, b, NULL)");
-        assert_eq!(display_string, "Use a@0 IN (SET) ([Literal { value: 
Utf8(\"a\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(\"b\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(NULL), field: Field { name: \"lit\", data_type: Utf8, nullable: true, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }])");
+        assert_eq!(display_string, "a@0 IN (SET) ([a, b, NULL])");
 
         // Test: a NOT IN ('a', 'b', NULL)
         let list = vec![lit("a"), lit("b"), lit(ScalarValue::Utf8(None))];
         let expr = in_list(Arc::clone(&col_a), list, &true, &schema)?;
         let sql_string = fmt_sql(expr.as_ref()).to_string();
         let display_string = expr.to_string();
         assert_eq!(sql_string, "a NOT IN (a, b, NULL)");
-        assert_eq!(display_string, "a@0 NOT IN (SET) ([Literal { value: 
Utf8(\"a\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(\"b\"), field: Field { name: \"lit\", data_type: Utf8, nullable: false, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }, Literal { value: 
Utf8(NULL), field: Field { name: \"lit\", data_type: Utf8, nullable: true, 
dict_id: 0, dict_is_ordered: false, metadata: {} } }])");
+        assert_eq!(display_string, "a@0 NOT IN (SET) ([a, b, NULL])");

Review Comment:
   I've been wondering about the difference in formatting of literals between 
logical and physical plans. Logical will show `Utf8("a")` while physical shows 
just `a`. Out of scope for what I'm doing here, but would you want the type 
information in physical as well? For string literals in particular I think 
quotes would be a useful addition to avoid any possible confusion with column 
or table names.



-- 
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