jonahgao commented on issue #13570: URL: https://github.com/apache/datafusion/issues/13570#issuecomment-2648055675
> I've started to put together some basic documentation for prepared statements, but when generating examples I'm struggling to use named parameters. > > Using `SessionContext::sql()` for example will hit [this](https://github.com/apache/datafusion/blob/603721d38ef9f187deaf76664e7b1679e44a90cd/datafusion/sql/src/expr/value.rs#L124) validation ensuring a `$1` style placeholder is used rather than `:name`. > > Creating a logical plan from the SQL string has a similar issue, preventing the user from later calling `replace_params_with_values`. I think it should be supported because this [test](https://github.com/apache/datafusion/blob/17396a530f9178903e007f364148cd79242b7a43/datafusion/core/tests/sql/select.rs#L54) can be passed. But it seems that we can't EXECUTE it by SQL. ```sh DataFusion CLI v45.0.0 > prepare p1 as select $foo; 0 row(s) fetched. Elapsed 0.003 seconds. > execute p1(foo := 1); 🤔 Invalid statement: sql parser error: Expected: ), found: := at Line: 1, Column: 16 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org