Skip to content

Commit b9b3577

Browse files
committed
improve error message on unknown placeholder
1 parent 2e1b3f6 commit b9b3577

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

datafusion/sql/src/expr/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
134134
format!("${}", pos + 1),
135135
param_data_types.get(pos).cloned(),
136136
))),
137-
None => plan_err!("Invalid placeholder: {param}"),
137+
None => plan_err!("Unknown placeholder: {param}"),
138138
}
139139
};
140140
}

datafusion/sql/tests/cases/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn test_prepare_statement_to_plan_panic_param_format() {
105105
assert_snapshot!(
106106
logical_plan(sql).unwrap_err().strip_backtrace(),
107107
@r###"
108-
Error during planning: Invalid placeholder: $foo
108+
Error during planning: Unknown placeholder: $foo
109109
"###
110110
);
111111
}

datafusion/sqllogictest/test_files/prepare.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ statement error DataFusion error: SQL error: ParserError
3434
PREPARE AS SELECT id, age FROM person WHERE age = $foo;
3535

3636
# param following a non-number, $foo, not supported
37-
statement error Invalid placeholder: \$foo
37+
statement error Unknown placeholder: \$foo
3838
PREPARE my_plan(INT) AS SELECT id, age FROM person WHERE age = $foo;
3939

4040
# not specify table hence cannot specify columns

0 commit comments

Comments
 (0)