Skip to content

Commit 8d50405

Browse files
committed
update docstring / comment in create_placeholder_expr
1 parent b9b3577 commit 8d50405

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

datafusion/sql/src/expr/value.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
104104
}
105105

106106
/// Create a placeholder expression
107-
/// This is the same as Postgres's prepare statement syntax in which a placeholder starts with `$` sign and then
108-
/// number 1, 2, ... etc. For example, `$1` is the first placeholder; $2 is the second one and so on.
107+
/// Both named (`$foo`) and positional (`$1`, `$2`, ...) placeholder styles are supported.
109108
fn create_placeholder_expr(
110109
param: String,
111110
param_data_types: &[FieldRef],
112111
) -> Result<Expr> {
113-
// Parse the placeholder as a number because it is the only support from sqlparser and postgres
112+
// Try to parse the placeholder as a number. If the placeholder does not have a valid
113+
// positional value, assume we have a named placeholder.
114114
let index = param[1..].parse::<usize>();
115115
let idx = match index {
116116
Ok(0) => {

0 commit comments

Comments
 (0)