Skip to content

Commit a62d369

Browse files
committed
fix: remove query normalization step
1 parent 2c21244 commit a62d369

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

datafusion-postgres/src/handlers.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,12 @@ impl SimpleQueryHandler for DfSessionService {
216216
return Ok(vec![Response::Query(resp)]);
217217
}
218218

219-
let ctx = &self.session_context;
220-
let qualified_query = if !query_lower.contains(&format!("{}.", self.catalog_name))
221-
&& !query_lower.contains("information_schema")
222-
&& !query_lower.contains("pg_catalog")
223-
&& query_lower.contains("from")
224-
{
225-
query.replace(" FROM ", &format!(" FROM {}.", self.catalog_name))
226-
} else {
227-
query.to_string()
228-
};
229-
230-
let df = ctx
231-
.sql(&qualified_query)
219+
let df = self
220+
.session_context
221+
.sql(query)
232222
.await
233223
.map_err(|e| PgWireError::ApiError(Box::new(e)))?;
234224

235-
let query_lower = query.to_lowercase();
236225
if query_lower.starts_with("insert into") {
237226
// For INSERT queries, we need to execute the query to get the row count
238227
// and return an Execution response with the proper tag

0 commit comments

Comments
 (0)