You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lambda examples in the SQL function docs fail with the default dialect #25960
The SQL reference examples for any_match, array_filter, array_first and array_transform use lambda syntax (x -> x > 2), but none of them run in datafusion-cli with the default dialect. The -> is not parsed as a lambda, so the error points at the parameter instead:
> select array_filter([1, 2, 3, 4, 5], x -> x > 2);
Error: Schema error: No field named x.
The same happens for the other three examples. They work after switching to a dialect whose supports_lambda_functions() is true (databricks, duckdb, snowflake, spark, clickhouse):
> set datafusion.sql_parser.dialect = 'duckdb';
> select array_filter([1, 2, 3, 4, 5], x -> x > 2);
[3, 4, 5]
The sqllogictest files for these functions already do this (array_transform.slt and array_any_match.slt start with set datafusion.sql_parser.dialect = databricks;), so the requirement is known; the user guide just doesn't mention it.
To Reproduce
datafusion-cli built from main at 4d167a1, then any of the four documented examples.
Expected behavior
Either the docs say that lambdas need one of those dialects (a note on each function, or once at the top of the higher-order functions section), or lambdas parse under the default dialect. The note is the small fix. Happy to send a PR for it, generated through dev/update_function_docs.sh from the #[user_doc] attributes.
Additional context
Found by running every SQL example in scalar_functions.md against a main build. Written with Claude Code (Claude Opus 5.5).
Activity