melgenek commented on code in PR #5253:
URL: https://github.com/apache/arrow-datafusion/pull/5253#discussion_r1103701919
##########
datafusion/core/tests/sqllogictests/src/engines/postgres/mod.rs:
##########
@@ -290,27 +249,20 @@ impl sqllogictest::AsyncDB for Postgres {
return Ok(DBOutput::StatementComplete(0));
}
let rows = self.client.query(sql, &[]).await?;
- let output = rows
- .iter()
- .map(|row| {
- row.columns()
- .iter()
- .enumerate()
- .map(|(idx, column)| cell_to_string(row, column, idx))
- .collect::<Vec<String>>()
- })
- .collect::<Vec<_>>();
- if output.is_empty() {
- let stmt = self.client.prepare(sql).await?;
- Ok(DBOutput::Rows {
- types: vec![DFColumnType::Any; stmt.columns().len()],
- rows: vec![],
- })
+ if rows.is_empty() {
+ return Ok(DBOutput::StatementComplete(0));
Review Comment:
Makes sense. I updated the implementation here
https://github.com/apache/arrow-datafusion/pull/5253/commits/e9733d76179f2a9cbb841d94f6239c12ab7115b8.
As a side note, I noticed that `sqllogictest-rs` doesn't implement checks
when the expected record is a statement, for example, `statement ok`. In this
case, even if the client implementation returns results, neither types nor
actual rows would be checked.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]