()
| 212 | |
| 213 | #[test] |
| 214 | fn test_fmt_sql() -> Result<()> { |
| 215 | let schema = Schema::new(vec![Field::new("a", DataType::Utf8, true)]); |
| 216 | |
| 217 | // expression: "a is null" |
| 218 | let expr = is_null(col("a", &schema)?).unwrap(); |
| 219 | let display_string = expr.to_string(); |
| 220 | assert_eq!(display_string, "a@0 IS NULL"); |
| 221 | let sql_string = fmt_sql(expr.as_ref()).to_string(); |
| 222 | assert_eq!(sql_string, "a IS NULL"); |
| 223 | |
| 224 | Ok(()) |
| 225 | } |
| 226 | } |