comphead commented on code in PR #17520:
URL: https://github.com/apache/datafusion/pull/17520#discussion_r2341523858


##########
datafusion/core/tests/sql/select.rs:
##########
@@ -344,3 +344,27 @@ async fn test_version_function() {
 
     assert_eq!(version.value(0), expected_version);
 }
+
+/// Regression test for https://github.com/apache/datafusion/issues/17513
+/// See https://github.com/apache/datafusion/pull/17520
+#[tokio::test]
+async fn test_select_no_projection() -> Result<()> {
+    let tmp_dir = TempDir::new()?;
+    let ctx = create_ctx_with_partition(&tmp_dir, 1).await?;
+
+    let results = ctx.sql("SELECT FROM test").await?.collect().await?;
+    // We should get all of the rows, just without any columns
+    let total_rows: usize = results.iter().map(|b| b.num_rows()).sum();
+    assert_eq!(total_rows, 10); // `create_ctx_with_partition` creates 10 rows 
per partition and we chose 1 partition

Review Comment:
   ```suggestion
        // `create_ctx_with_partition` creates 10 rows per partition and we 
chose 1 partition
       let ctx = create_ctx_with_partition(&tmp_dir, 1).await?;
   
       let results = ctx.sql("SELECT FROM test").await?.collect().await?;
       // We should get all of the rows, just without any columns
       let total_rows: usize = results.iter().map(|b| b.num_rows()).sum();
       assert_eq!(total_rows, 10);
   ```



-- 
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

Reply via email to