@@ -19,10 +19,10 @@ use pgwire::api::{ClientInfo, ErrorHandler, PgWireServerHandlers, Type};
1919use pgwire:: error:: { PgWireError , PgWireResult } ;
2020use pgwire:: types:: format:: FormatOptions ;
2121
22- use crate :: client;
2322use crate :: hooks:: set_show:: SetShowHook ;
2423use crate :: hooks:: transactions:: TransactionStatementHook ;
2524use crate :: hooks:: QueryHook ;
25+ use crate :: { client, planner} ;
2626use arrow_pg:: datatypes:: df;
2727use arrow_pg:: datatypes:: { arrow_schema_to_pg_fields, into_pg_type} ;
2828use datafusion_pg_catalog:: sql:: PostgresCompatibilityParser ;
@@ -215,8 +215,7 @@ impl ExtendedQueryHandler for DfSessionService {
215215 if !self . query_hooks . is_empty ( ) {
216216 if let ( _, Some ( ( statement, plan) ) ) = & portal. statement . statement {
217217 // TODO: in the case where query hooks all return None, we do the param handling again later.
218- let param_types = plan
219- . get_parameter_types ( )
218+ let param_types = planner:: get_inferred_parameter_types ( plan)
220219 . map_err ( |e| PgWireError :: ApiError ( Box :: new ( e) ) ) ?;
221220
222221 let param_values: ParamValues =
@@ -240,8 +239,7 @@ impl ExtendedQueryHandler for DfSessionService {
240239 }
241240
242241 if let ( _, Some ( ( statement, plan) ) ) = & portal. statement . statement {
243- let param_types = plan
244- . get_parameter_types ( )
242+ let param_types = planner:: get_inferred_parameter_types ( plan)
245243 . map_err ( |e| PgWireError :: ApiError ( Box :: new ( e) ) ) ?;
246244
247245 let param_values =
@@ -381,8 +379,7 @@ impl QueryParser for Parser {
381379
382380 fn get_parameter_types ( & self , stmt : & Self :: Statement ) -> PgWireResult < Vec < Type > > {
383381 if let ( _, Some ( ( _, plan) ) ) = stmt {
384- let params = plan
385- . get_parameter_types ( )
382+ let params = planner:: get_inferred_parameter_types ( plan)
386383 . map_err ( |e| PgWireError :: ApiError ( Box :: new ( e) ) ) ?;
387384
388385 let mut param_types = Vec :: with_capacity ( params. len ( ) ) ;
0 commit comments