| 1357 | |
| 1358 | #[test] |
| 1359 | fn test_fmt_sql_4() -> Result<()> { |
| 1360 | let schema = Schema::new(vec![Field::new("a", DataType::Utf8, true)]); |
| 1361 | let col_a = col("a", &schema)?; |
| 1362 | // Test: a NOT IN ('a', 'b', NULL) |
| 1363 | let list = vec![lit("a"), lit("b"), lit(ScalarValue::Utf8(None))]; |
| 1364 | let expr = in_list(Arc::clone(&col_a), list, &true, &schema)?; |
| 1365 | let sql_string = fmt_sql(expr.as_ref()).to_string(); |
| 1366 | let display_string = expr.to_string(); |
| 1367 | assert_snapshot!(sql_string, @"a NOT IN (a, b, NULL)"); |
| 1368 | assert_snapshot!(display_string, @"a@0 NOT IN (SET) ([a, b, NULL])"); |
| 1369 | Ok(()) |
| 1370 | } |
| 1371 | |
| 1372 | #[test] |
| 1373 | fn in_list_struct() -> Result<()> { |