MCPcopy Create free account
hub / github.com/apache/datafusion / test_select_no_projection

Function test_select_no_projection

datafusion/core/tests/sql/select.rs:396–416  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394/// See https://github.com/apache/datafusion/pull/17520
395#[tokio::test]
396async fn test_select_no_projection() -> Result<()> {
397 let tmp_dir = TempDir::new()?;
398 // `create_ctx_with_partition` creates 10 rows per partition and we chose 1 partition
399 let ctx = create_ctx_with_partition(&tmp_dir, 1).await?;
400
401 let results = ctx.sql("SELECT FROM test").await?.collect().await?;
402 // We should get all of the rows, just without any columns
403 let total_rows: usize = results.iter().map(|b| b.num_rows()).sum();
404 assert_eq!(total_rows, 10);
405 // Check that none of the batches have any columns
406 for batch in &results {
407 assert_eq!(batch.num_columns(), 0);
408 }
409 // Sanity check the output, should be just empty columns
410 assert_snapshot!(batches_to_sort_string(&results), @r"
411 ++
412 ++
413 ++
414 ");
415 Ok(())
416}
417
418#[tokio::test]
419async fn test_select_cast_date_literal_to_timestamp_overflow() -> Result<()> {

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
collectMethod · 0.80
sqlMethod · 0.80
sumMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…