This is an automated email from the ASF dual-hosted git repository.
milenkovicm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-ballista.git
The following commit(s) were added to refs/heads/main by this push:
new 5c832053a minor: add test to cover IPC arrow file read (#1450)
5c832053a is described below
commit 5c832053a6197e51c9005de53ad227281e28dd85
Author: Marko Milenković <[email protected]>
AuthorDate: Wed Feb 11 09:37:16 2026 +0000
minor: add test to cover IPC arrow file read (#1450)
* add test to cover arrow read
* Update ballista/client/tests/context_unsupported.rs
Co-authored-by: jgrim <[email protected]>
---------
Co-authored-by: jgrim <[email protected]>
---
ballista/client/src/prelude.rs | 6 ----
ballista/client/testdata/alltypes_plain.arrow | Bin 0 -> 3762 bytes
ballista/client/tests/context_checks.rs | 48 +++-----------------------
ballista/client/tests/context_unsupported.rs | 47 +++++++++++++++++++++++++
4 files changed, 51 insertions(+), 50 deletions(-)
diff --git a/ballista/client/src/prelude.rs b/ballista/client/src/prelude.rs
index ca6860d9e..1fe9d6757 100644
--- a/ballista/client/src/prelude.rs
+++ b/ballista/client/src/prelude.rs
@@ -17,10 +17,4 @@
//! Ballista Prelude (common imports)
-// pub use ballista_core::{
-// config::BallistaConfig,
-// error::{BallistaError, Result},
-// };
-
pub use crate::extension::{SessionConfigExt, SessionContextExt};
-//pub use futures::StreamExt;
diff --git a/ballista/client/testdata/alltypes_plain.arrow
b/ballista/client/testdata/alltypes_plain.arrow
new file mode 100644
index 000000000..9e44226e7
Binary files /dev/null and b/ballista/client/testdata/alltypes_plain.arrow
differ
diff --git a/ballista/client/tests/context_checks.rs
b/ballista/client/tests/context_checks.rs
index 14d32ab66..908e9c23d 100644
--- a/ballista/client/tests/context_checks.rs
+++ b/ballista/client/tests/context_checks.rs
@@ -24,6 +24,7 @@ mod supported {
standalone_context_with_state,
};
use ballista_core::config::BallistaConfig;
+
use datafusion::physical_plan::collect;
use datafusion::prelude::*;
use datafusion::{assert_batches_eq, prelude::SessionContext};
@@ -39,7 +40,7 @@ mod supported {
#[case::standalone(standalone_context())]
#[case::remote(remote_context())]
#[tokio::test]
- async fn should_execute_sql_show(
+ async fn should_execute_sql_collect(
#[future(awt)]
#[case]
ctx: SessionContext,
@@ -337,6 +338,7 @@ mod supported {
ctx: SessionContext,
test_data: String,
) -> datafusion::error::Result<()> {
+ // registering table to show in show tables
ctx.register_parquet(
"test",
&format!("{test_data}/alltypes_plain.parquet"),
@@ -402,7 +404,7 @@ mod supported {
#[case::standalone(standalone_context())]
#[case::remote(remote_context())]
#[tokio::test]
- async fn should_execute_dataframe(
+ async fn should_collect_from_dataframe(
#[future(awt)]
#[case]
ctx: SessionContext,
@@ -481,48 +483,6 @@ mod supported {
Ok(())
}
- #[rstest]
- #[case::standalone(standalone_context())]
- #[case::remote(remote_context())]
- #[tokio::test]
- async fn should_execute_sql_app_name_show(
- #[future(awt)]
- #[case]
- ctx: SessionContext,
- test_data: String,
- ) -> datafusion::error::Result<()> {
- ctx.sql("SET ballista.job.name = 'Super Cool Ballista App'")
- .await?
- .show()
- .await?;
-
- ctx.register_parquet(
- "test",
- &format!("{test_data}/alltypes_plain.parquet"),
- Default::default(),
- )
- .await?;
-
- let result = ctx
- .sql("select string_col, timestamp_col from test where id > 4")
- .await?
- .collect()
- .await?;
- let expected = [
- "+------------+---------------------+",
- "| string_col | timestamp_col |",
- "+------------+---------------------+",
- "| 31 | 2009-03-01T00:01:00 |",
- "| 30 | 2009-04-01T00:00:00 |",
- "| 31 | 2009-04-01T00:01:00 |",
- "+------------+---------------------+",
- ];
-
- assert_batches_eq!(expected, &result);
-
- Ok(())
- }
-
// test checks if this view types have been disabled in the configuration
//
// `datafusion.execution.parquet.schema_force_view_types` have been
disabled
diff --git a/ballista/client/tests/context_unsupported.rs
b/ballista/client/tests/context_unsupported.rs
index 7d5c91f8f..8cda528ee 100644
--- a/ballista/client/tests/context_unsupported.rs
+++ b/ballista/client/tests/context_unsupported.rs
@@ -96,4 +96,51 @@ mod unsupported {
assert_batches_eq!(expected, &result);
}
+
+ #[rstest]
+ #[case::standalone(standalone_context())]
+ #[case::remote(remote_context())]
+ #[tokio::test]
+
+ async fn should_execute_sql_collect_from_arrow_file(
+ #[future(awt)]
+ #[case]
+ ctx: SessionContext,
+ test_data: String,
+ ) -> datafusion::error::Result<()> {
+ ctx.register_arrow(
+ "test",
+ &format!("{test_data}/alltypes_plain.arrow"),
+ Default::default(),
+ )
+ .await?;
+
+ let result = ctx
+ .sql("select string_col, timestamp_col from test where id > 4")
+ .await?
+ .collect()
+ .await;
+
+ // at the moment its not supported
+ assert!(result.is_err());
+
+ // let result = ctx
+ // .sql("select string_col, timestamp_col from test where id > 4")
+ // .await?
+ // .collect()
+ // .await?;
+ // let expected = [
+ // "+------------+---------------------+",
+ // "| string_col | timestamp_col |",
+ // "+------------+---------------------+",
+ // "| 31 | 2009-03-01T00:01:00 |",
+ // "| 30 | 2009-04-01T00:00:00 |",
+ // "| 31 | 2009-04-01T00:01:00 |",
+ // "+------------+---------------------+",
+ // ];
+
+ // assert_batches_eq!(expected, &result);
+
+ Ok(())
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]