alamb commented on code in PR #5253:
URL: https://github.com/apache/arrow-datafusion/pull/5253#discussion_r1103630180
##########
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:
The opposite (empty result as a query result with schema) is probably a
better behavior as it would allow checking types for statements like `COUNT(*)
FROM foo WHERE false`
--
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]