Skip to content

Apache DataFusion SQL Query Engine

ARROW-10109: [Rust] Add support to the C data interface for primitive types and utf8

Jorge C. Leitao75ad5e8cf5bb
diff --git a/.github/workflows/rust_cron.yml b/.github/workflows/rust_cron.yml
index fed6a99654..11af0aba36 100644
--- a/.github/workflows/rust_cron.yml
+++ b/.github/workflows/rust_cron.yml
@@ -54,3 +54,26 @@ jobs:
continue-on-error: true
shell: bash
run: bash <(curl -s https://codecov.io/bash)
+
+ pyarrow-integration:
+ name: AMD64 Debian 10 Rust ${{ matrix.rust }} Pyarrow integration
+ runs-on: ubuntu-latest
+ if: ${{ !contains(github.event.pull_request.title, 'WIP') && github.repository == 'apache/arrow' }}
+ strategy:
+ fail-fast: false
+ matrix:
+ rust: [nightly-2020-11-19]
+ env:
+ RUST: ${{ matrix.rust }}
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Fetch Submodules and Tags
+ run: ci/scripts/util_checkout.sh
+ - name: Run test
+ shell: bash
+ run: |
+ echo ${RUST} > rust/rust-toolchain &&
+ ci/scripts/rust_pyarrow_integration.sh `pwd` `pwd`/build $RUST
diff --git a/ci/docker/debian-10-rust.dockerfile b/ci/docker/debian-10-rust.dockerfile
index 39df235ac8..99507cf796 100644
--- a/ci/docker/debian-10-rust.dockerfile
+++ b/ci/docker/debian-10-rust.dockerfile
@@ -53,7 +53,8 @@ ENV CARGO_HOME="/rust/cargo" \
# compiled dependencies. Create the directories and place an empty lib.rs
# files.
COPY rust /arrow/rust
-RUN mkdir \
+RUN mkdir -p \
+ /arrow/rust/arrow-pyarrow-integration-testing/src \
/arrow/rust/arrow-flight/src \
/arrow/rust/arrow/src \
/arrow/rust/benchmarks/src \
@@ -63,6 +64,7 @@ RUN mkdir \
/arrow/rust/parquet_derive/src \
/arrow/rust/parquet_derive_test/src && \
touch \
+ /arrow/rust/arrow-pyarrow-integration-testing/src/lib.rs \
/arrow/rust/arrow-flight/src/lib.rs \
/arrow/rust/arrow/src/lib.rs \
/arrow/rust/benchmarks/src/lib.rs \
diff --git a/ci/scripts/rust_pyarrow_integration.sh b/ci/scripts/rust_pyarrow_integration.sh
new file mode 100755
index 0000000000..e420811414
--- /dev/null
+++ b/ci/scripts/rust_pyarrow_integration.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+#
+# 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.
+
+set -ex
+
+arrow_dir=${1}
+source_dir=${1}/rust
+build_dir=${2}/rust
+rust=${3}
+
+export ARROW_TEST_DATA=${arrow_dir}/testing/data
+export PARQUET_TEST_DATA=${arrow_dir}/cpp/submodules/parquet-testing/data
+export CARGO_TARGET_DIR=${build_dir}
+
+pushd ${source_dir}/arrow-pyarrow-integration-testing
+
+#rustup default ${rust}
+#rustup component add rustfmt --toolchain ${rust}-x86_64-unknown-linux-gnu
+python3 -m venv venv
+venv/bin/pip install maturin==0.8.2 toml==0.10.1 pyarrow==1.0.0
+
+source venv/bin/activate
+maturin develop
+python -m unittest discover tests
+
+popd
diff --git a/dev/release/00-prepare-test.rb b/dev/release/00-prepare-test.rb
index b601f14141..7ae4473b3d 100644
--- a/dev/release/00-prepare-test.rb
+++ b/dev/release/00-prepare-test.rb
@@ -271,6 +271,15 @@ class PrepareTest < Test::Unit::TestCase
"+arrow = { path = \"../arrow\", version = \"#{@release_version}\" }"],
],
},
+ {
+ path: "rust/arrow-pyarrow-integration-testing/Cargo.toml",
+ hunks: [
+ ["-version = \"#{@snapshot_version}\"",
+ "+version = \"#{@release_version}\""],
+ ["-arrow = { path = \"../arrow\", version = \"#{@snapshot_version}\" }",
+ "+arrow = { path = \"../arrow\", version = \"#{@release_version}\" }"],
+ ],
+ },
{
path: "rust/arrow/Cargo.toml",
hunks: [
@@ -509,6 +518,15 @@ class PrepareTest < Test::Unit::TestCase
"+arrow = { path = \"../arrow\", version = \"#{@next_snapshot_version}\" }"],
],
},
+ {
+ path: "rust/arrow-pyarrow-integration-testing/Cargo.toml",
+ hunks: [
+ ["-version = \"#{@release_version}\"",
+ "+version = \"#{@next_snapshot_version}\""],
+ ["-arrow = { path = \"../arrow\", version = \"#{@release_version}\" }",
+ "+arrow = { path = \"../arrow\", version = \"#{@next_snapshot_version}\" }"],
+ ],
+ },
{
path: "rust/arrow/Cargo.toml",
hunks: [
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 459fe8fd4e..16e34de7f1 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -26,3 +26,8 @@ members = [
"integration-testing",
"benchmarks",
]
+
+# this package is excluded because it requires different compilation flags, thereby significantly changing
+# how it is compiled within the workspace, causing the whole workspace to be compiled from scratch
+# this way, this is a stand-alone package that compiles independently of the others.
+exclude = ["arrow-pyarrow-integration-testing"]