This is an automated email from the ASF dual-hosted git repository.

agrove 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 3a466690 feat: add test to check for `ctx.enable_url_table()` (#1155)
3a466690 is described below

commit 3a4666906a29cb49400839d8ec43ce09ff20492c
Author: Marko Milenković <[email protected]>
AuthorDate: Mon Jan 6 17:06:49 2025 +0000

    feat: add test to check for `ctx.enable_url_table()` (#1155)
---
 ballista/client/tests/context_unsupported.rs | 41 ++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/ballista/client/tests/context_unsupported.rs 
b/ballista/client/tests/context_unsupported.rs
index 805e8132..347071e5 100644
--- a/ballista/client/tests/context_unsupported.rs
+++ b/ballista/client/tests/context_unsupported.rs
@@ -211,4 +211,45 @@ 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);
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to