-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GH-44515: [D] Add Initial Support #44536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0103c3c
Initial D bindings support
kassane 254e47f
reboot
kassane ddbfce9
Update .github/workflows/d.yml
kassane 101503d
Update .github/workflows/d.yml
kassane 212e195
Update .github/workflows/d.yml
kassane 644b192
dub in rat_exclude_files
kassane 253f3ac
remove generated dub.json (gidgen)
kassane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# 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. | ||
|
||
name: D | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!dependabot/**' | ||
tags: | ||
- '**' | ||
paths: | ||
- '.dockerignore' | ||
- '.github/workflows/d.yml' | ||
- 'ci/docker/*-d.dockerfile' | ||
- 'ci/scripts/c_glib_*' | ||
- 'ci/scripts/cpp_*' | ||
- 'ci/scripts/d_*' | ||
- 'c_glib/**' | ||
- 'cpp/**' | ||
- 'docker-compose.yml' | ||
- 'd/**' | ||
pull_request: | ||
paths: | ||
- '.dockerignore' | ||
- '.github/workflows/d.yml' | ||
- 'ci/docker/*d*' | ||
- 'ci/scripts/c_glib_*' | ||
- 'ci/scripts/cpp_*' | ||
- 'ci/scripts/d_*' | ||
- 'c_glib/**' | ||
- 'cpp/**' | ||
- 'docker-compose.yml' | ||
- 'd/**' | ||
|
||
concurrency: | ||
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
ARCHERY_DEBUG: 1 | ||
DOCKER_VOLUME_PREFIX: ".docker/" | ||
|
||
jobs: | ||
docker: | ||
name: AMD64 Ubuntu ${{ matrix.ubuntu }} GLib & D | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ubuntu: | ||
- 22.04 | ||
env: | ||
UBUNTU: ${{ matrix.ubuntu }} | ||
steps: | ||
- name: Checkout Arrow | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Setup Python on hosted runner | ||
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | ||
with: | ||
python-version: 3 | ||
- name: Setup Archery | ||
run: pip install -e dev/archery[docker] | ||
- name: Execute Docker Build | ||
env: | ||
ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} | ||
ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | ||
run: | | ||
source ci/scripts/util_enable_core_dumps.sh | ||
archery docker run ubuntu-d | ||
- name: Docker Push | ||
if: >- | ||
success() && | ||
github.event_name == 'push' && | ||
github.repository == 'apache/arrow' && | ||
github.ref_name == 'main' | ||
env: | ||
ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} | ||
ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | ||
continue-on-error: true | ||
run: archery docker push ubuntu-d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 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. | ||
|
||
ARG base | ||
FROM ${base} | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
RUN echo "debconf debconf/frontend select Noninteractive" | | ||
debconf-set-selections | ||
|
||
# Install ldc2 toolchain (dmd-frontend + llvm-backend), dub package manager & meson build system | ||
RUN apt-get update -y -q && | ||
apt-get install -y -q --no-install-recommends \ | ||
dub \ | ||
ldc \ | ||
meson \ | ||
pkg-config && | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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 | ||
|
||
source_dir=${1}/d | ||
|
||
export DYLD_LIBRARY_PATH=${ARROW_HOME}/lib:${DYLD_LIBRARY_PATH} | ||
export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH} | ||
export PKG_CONFIG_PATH=${ARROW_HOME}/lib/pkgconfig | ||
export GI_TYPELIB_PATH=${ARROW_HOME}/lib/girepository-1.0 | ||
|
||
# Enable memory debug checks if the env is not set already | ||
if [ -z "${ARROW_DEBUG_MEMORY_POOL}" ]; then | ||
export ARROW_DEBUG_MEMORY_POOL=trap | ||
fi | ||
|
||
dub test --root=${source_dir} |
Submodule parquet-testing
updated
19 files
kassane marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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. | ||
|
||
# unittest executable | ||
unittest/ | ||
# generated files | ||
source/*-*/ | ||
report.txt | ||
dub.selections.json | ||
source/dub.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!--- | ||
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. | ||
--> | ||
|
||
# Apache Arrow D | ||
|
||
An implementation of Arrow targeting D programming language. | ||
|
||
See our current [feature matrix](https://github.com/apache/arrow/blob/main/docs/source/status.rst) | ||
for currently available features. | ||
|
||
## Requirements | ||
|
||
- [dmd/gdc/ldc2](https://dlang.org/download) with druntime-frontend 2.105.0 or later | ||
|
||
## Building | ||
|
||
- build Apache Arrow C++ | ||
- build Apache Arrow GLib | ||
- build D bindings | ||
|
||
```console | ||
$ git clone https://github.com/apache/arrow.git | ||
$ cd arrow/d | ||
$ dub build -b release | ||
# Test | ||
$ dub test | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
//!repo Arrow-1.0 | ||
|
||
//# Arrow.Buffer.Buffer.slice() conflicts with parent Arrow.MutableBuffer.MutableBuffer.slice() | ||
//!set class[Buffer].method[slice][name] slice_data |
kassane marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "arrow-d", | ||
"description": "Apache Arrow - D bindings", | ||
"license": "Apache-2.0", | ||
"toolchainRequirements": { | ||
"frontend": ">=2.105.3" | ||
}, | ||
"buildTypes": { | ||
"debug": { | ||
"buildOptions": [ | ||
"debugMode", | ||
"debugInfo" | ||
] | ||
}, | ||
"release": { | ||
"buildOptions": [ | ||
"releaseMode", | ||
"inline", | ||
"optimize" | ||
] | ||
} | ||
}, | ||
"dependencies": { | ||
"gidgen": { | ||
"repository": "git+https://github.com/Kymorphia/gidgen.git", | ||
"version": "0a3ee4177a2f4973f39ffac3fe2e4542f45f9708" | ||
}, | ||
"gid:glib-2-0": "~>0.9.1" | ||
}, | ||
"preBuildCommands": [ | ||
"\"$DUB\" run gidgen -- --log-level off --report --report-file report.txt -d $PACKAGE_DIR/defs -s $PACKAGE_DIR/source -g $PACKAGE_DIR/c_glib.build/arrow-glib -p $PACKAGE_DIR/source -d ${GID:GLIB_2_0_PACKAGE_DIR}/../../defs -g ${GID:GLIB_2_0_PACKAGE_DIR}/../../gir" | ||
], | ||
"lflags-posix": [ | ||
"-L$PACKAGE_DIR/c_glib.build/arrow-glib" | ||
], | ||
"libs": [ | ||
"arrow-glib" | ||
], | ||
"configurations": [ | ||
{ | ||
"name": "unittest", | ||
"targetPath": "unittest", | ||
"sourceFiles": [ | ||
"source/package.d" | ||
], | ||
"dflags-dmd": [ | ||
"-verrors=context" | ||
], | ||
"dflags-ldc": [ | ||
"--verrors-context", | ||
"-link-defaultlib-shared" | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module Arrow; | ||
|
||
version (unittest) | ||
{ | ||
import Arrow.Array; | ||
import Arrow.DataType; | ||
import Arrow.BooleanArray; | ||
import Arrow.CastOptions; | ||
import Arrow.FilterOptions; | ||
import Arrow.TakeOptions; | ||
import Arrow.c.types; | ||
|
||
@("Arrow Array") | ||
unittest | ||
{ | ||
// Test array creation and basic properties | ||
auto array = new Array(null); | ||
assert(array.getLength() == 0); | ||
assert(array.getNNulls() == 0); | ||
assert(array.getOffset() == 0); | ||
|
||
// Test null checks | ||
auto nullBitmap = array.getNullBitmap(); | ||
assert(nullBitmap is null, "Null bitmap should be null"); | ||
|
||
// Test value type | ||
auto valueType = array.getValueType(); | ||
assert(valueType >= GArrowType.Na, "Value type should be non-null"); | ||
|
||
// Test equality | ||
auto otherArray = new Array(null); | ||
assert(array.equal(otherArray), "Arrays should be equal"); | ||
assert(array.equalApprox(otherArray), "Arrays should be equalApprox"); | ||
|
||
// Test slicing | ||
auto slice = array.slice(0, 0); | ||
assert(slice !is null, "Slice should not be null"); | ||
|
||
// Test data type | ||
auto dataType = array.getValueDataType(); | ||
assert(dataType is null || dataType !is null, "Data type should be non-null"); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this to
linux-apt-d.dockerfile
and useubuntu-c-glib
as the base image likeubuntu-ruby
does?arrow/docker-compose.yml
Lines 853 to 875 in 33e8cbb