From 0823267a5f9fbbd699a0e103ad0b297f785bde9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Sat, 8 Feb 2025 17:10:54 +0000 Subject: [PATCH] move test to supported in this version --- ballista/client/tests/context_checks.rs | 34 ++++++++++++++++ ballista/client/tests/context_unsupported.rs | 41 -------------------- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git a/ballista/client/tests/context_checks.rs b/ballista/client/tests/context_checks.rs index a46f93803..ac83e3bdf 100644 --- a/ballista/client/tests/context_checks.rs +++ b/ballista/client/tests/context_checks.rs @@ -365,4 +365,38 @@ mod supported { Ok(()) } + + /// looks like `ctx.enable_url_table()` changes session context id. + #[rstest] + #[case::standalone(standalone_context())] + #[case::remote(remote_context())] + #[tokio::test] + async fn should_execute_sql_show_with_url_table( + #[future(awt)] + #[case] + ctx: SessionContext, + test_data: String, + ) { + let ctx = ctx.enable_url_table(); + + let result = ctx + .sql(&format!("select string_col, timestamp_col from '{test_data}/alltypes_plain.parquet' where id > 4")) + .await + .unwrap() + .collect() + .await + .unwrap(); + + 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); + } } diff --git a/ballista/client/tests/context_unsupported.rs b/ballista/client/tests/context_unsupported.rs index 347071e55..805e81325 100644 --- a/ballista/client/tests/context_unsupported.rs +++ b/ballista/client/tests/context_unsupported.rs @@ -211,45 +211,4 @@ mod unsupported { assert_batches_eq!(expected, &result); } - - /// looks like `ctx.enable_url_table()` changes session context id. - /// - /// Error returned: - /// ``` - /// Failed to load SessionContext for session ID b5530099-63d1-43b1-9e11-87ac83bb33e5: - /// General error: No session for b5530099-63d1-43b1-9e11-87ac83bb33e5 found - /// ``` - #[rstest] - #[case::standalone(standalone_context())] - #[case::remote(remote_context())] - #[tokio::test] - #[should_panic] - async fn should_execute_sql_show_with_url_table( - #[future(awt)] - #[case] - ctx: SessionContext, - test_data: String, - ) { - let ctx = ctx.enable_url_table(); - - let result = ctx - .sql(&format!("select string_col, timestamp_col from '{test_data}/alltypes_plain.parquet' where id > 4")) - .await - .unwrap() - .collect() - .await - .unwrap(); - - 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); - } }