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/03/24 01:52:56 UTC

[GitHub] [arrow-datafusion] liukun4515 commented on a change in pull request #2070: [Bug][Datafusion] fix TaskContext session_config bug

liukun4515 commented on a change in pull request #2070:
URL: https://github.com/apache/arrow-datafusion/pull/2070#discussion_r833851832



##########
File path: ballista-examples/examples/test_sql.rs
##########
@@ -0,0 +1,46 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use ballista::prelude::{BallistaConfig, BallistaContext, Result};
+use datafusion::prelude::CsvReadOptions;
+
+/// This example show the udf plugin is work
+///
+#[tokio::main]
+async fn main() -> Result<()> {
+    let config = BallistaConfig::builder()
+        .set("ballista.shuffle.partitions", "1")
+        .build()?;
+
+    let ctx = BallistaContext::standalone(&config, 10).await.unwrap();
+
+    let testdata = datafusion::test_util::arrow_test_data();
+
+    // register csv file with the execution context
+    ctx.register_csv(
+        "aggregate_test_100",
+        &format!("{}/csv/aggregate_test_100.csv", testdata),
+        CsvReadOptions::new(),
+    )
+    .await?;
+
+    // test udf
+    let df = ctx.sql("select count(1) from aggregate_test_100").await?;

Review comment:
       @alamb 
   Do we have the UT or IT for the ballista side?
   I think this `test_sql.rs` file just adds an example for the ballista.




-- 
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