Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/dialect/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ impl Dialect for GenericDialect {
true
}

fn supports_lambda_functions(&self) -> bool {
true
}

fn supports_select_wildcard_replace(&self) -> bool {
true
}
Expand Down
1 change: 1 addition & 0 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,7 @@ fn parse_json_ops_without_colon() {
Arrow,
all_dialects_except(|d| d.supports_lambda_functions()),
),
("->", Arrow, pg_and_generic()),
("->>", LongArrow, all_dialects()),
("#>", HashArrow, pg_and_generic()),
("#>>", HashLongArrow, pg_and_generic()),
Expand Down
8 changes: 4 additions & 4 deletions tests/sqlparser_duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,17 +882,17 @@ fn parse_extract_single_quotes() {
fn test_duckdb_lambda_function() {
// Test basic lambda with list_filter
let sql = "SELECT [3, 4, 5, 6].list_filter(lambda x : x > 4)";
duckdb_and_generic().verified_stmt(sql);
duckdb().verified_stmt(sql);

// Test lambda with arrow syntax (also supported by DuckDB)
let sql_arrow = "SELECT list_filter([1, 2, 3], x -> x > 1)";
duckdb_and_generic().verified_stmt(sql_arrow);
duckdb().verified_stmt(sql_arrow);

// Test lambda with multiple parameters (with index)
let sql_multi = "SELECT list_filter([1, 3, 1, 5], lambda x, i : x > i)";
duckdb_and_generic().verified_stmt(sql_multi);
duckdb().verified_stmt(sql_multi);

// Test lambda in list_transform
let sql_transform = "SELECT list_transform([1, 2, 3], lambda x : x * 2)";
duckdb_and_generic().verified_stmt(sql_transform);
duckdb().verified_stmt(sql_transform);
}
Loading