You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/16 10:10:40 UTC

[GitHub] [arrow-datafusion] ovr commented on a diff in pull request #3122: 'Rename `array()` function to `make_array()`, extend `array[]`

ovr commented on code in PR #3122:
URL: https://github.com/apache/arrow-datafusion/pull/3122#discussion_r946583259


##########
datafusion/core/tests/sql/functions.rs:
##########
@@ -124,43 +124,110 @@ async fn query_array() -> Result<()> {
             Arc::new(StringArray::from_slice(&["", "a", "aa", "aaa"])),
             Arc::new(Int32Array::from(vec![Some(0), Some(1), None, Some(3)])),
         ],
-    )?;
+    )
+    .unwrap();
 
-    let table = MemTable::try_new(schema, vec![vec![data]])?;
+    let table = MemTable::try_new(schema, vec![vec![data]]).unwrap();
 
     let ctx = SessionContext::new();
-    ctx.register_table("test", Arc::new(table))?;
-    let sql = "SELECT array(c1, cast(c2 as varchar)) FROM test";
+    ctx.register_table("test", Arc::new(table)).unwrap();
+    ctx
+}
+
+#[tokio::test]
+async fn query_array() {
+    let ctx = array_context();
+    let sql = "SELECT array[c1, cast(c2 as varchar)] FROM test";

Review Comment:
   👍 



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org