jonahgao commented on code in PR #13242: URL: https://github.com/apache/datafusion/pull/13242#discussion_r1830322644
########## datafusion/core/src/execution/session_state.rs: ########## @@ -906,6 +910,29 @@ impl SessionState { let udtf = self.table_functions.remove(name); Ok(udtf.map(|x| x.function().clone())) } + + /// Store the logical plan and the parameter types of a prepared statement. + pub(crate) fn store_prepared( + &mut self, + name: String, + data_types: Vec<DataType>, + plan: Arc<LogicalPlan>, + ) -> datafusion_common::Result<()> { + match self.prepared_plans.entry(name) { + Entry::Vacant(e) => { + e.insert(Arc::new(PreparedPlan { data_types, plan })); + Ok(()) + } + Entry::Occupied(e) => { + exec_err!("Prepared statement '{}' already exists", e.key()) Review Comment: I plan to implement DEALLOCATE in next PR. -- 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