12 Commits
Author SHA1 Message Date
Hiroyuki Sato d0f318d1da GH-51485: [C++] Fix SC2086 errors in cpp/examples/tutorial_examples directory (#51486)
### Rationale for this change

This is the sub issue #44748.

```
In build_arrow.sh line 23:
mkdir -p $ARROW_BUILD_DIR
         ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$ARROW_BUILD_DIR"

In build_arrow.sh line 24:
pushd $ARROW_BUILD_DIR
      ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$ARROW_BUILD_DIR"

In build_arrow.sh line 33:
    $ARROW_CMAKE_OPTIONS
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "$ARROW_CMAKE_OPTIONS"

In build_arrow.sh line 35:
make -j$NPROC
       ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
make -j"$NPROC"

In build_example.sh line 21:
mkdir -p $EXAMPLE_BUILD_DIR
         ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$EXAMPLE_BUILD_DIR"

In build_example.sh line 22:
pushd $EXAMPLE_BUILD_DIR
      ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$EXAMPLE_BUILD_DIR"

In build_example.sh line 24:
cmake /io $EXAMPLE_CMAKE_OPTIONS
          ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
cmake /io "$EXAMPLE_CMAKE_OPTIONS"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```

### What changes are included in this PR?

* SC2086: Quote variables

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

### Was AI used for this PR?

**PR code and description written by:**

- [x] Human
- [ ] AI

**Reviewed before submission by:**

- [x] Human
- [ ] AI
- [ ] Not reviewed

* GitHub Issue: #51485

Authored-by: Hiroyuki Sato <hiroysato@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2026-09-29 06:37:22 +09:00
fenfeng9andSutou Kouhei 75ef03165d GH-48394: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::ReadTable() (#48939)
### Rationale for this change
`FileReader::ReadTable` previously returned `Status` and required callers to pass an `out` parameter.
### What changes are included in this PR?
Introduce `Result<std::shared_ptr<Table>>` returning API to allow clearer error propagation:
  - Add new Result-returning `ReadTable()` methods
  - Deprecate the old Status versions
  - Migrate all callers to use the new API
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.

Status version FileReader::ReadTable has been deprecated.
```cpp
virtual ::arrow::Status ReadTable(std::shared_ptr<::arrow::Table>* out);

virtual ::arrow::Status ReadTable(const std::vector<int>& column_indices,
                                  std::shared_ptr<::arrow::Table>* out);
```
* GitHub Issue: #48394

Lead-authored-by: fenfeng9 <fenfeng9@qq.com>
Co-authored-by: fenfeng9 <36840213+fenfeng9@users.noreply.github.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2026-01-24 07:21:11 +09:00
Antoine Pitrou 30809c6f48 GH-45885: [C++] Require C++20 (#48414)
### Rationale for this change

We decided to migrate Arrow C++ to C++20 in this discussion: https://lists.apache.org/thread/48zlj0dn2y0f53y2k37qsr90y781wfnj

### What changes are included in this PR?

1. Build configuration updates (CMake files etc.) to build with C++20 instead of C++17

2. C++-level fixes to ensure compilation succeeds:

    * Workarounds for deprecation of atomic access on `std::shared_ptr<T>` (the replacement `std::atomic<std::shared_ptr<T>>` is unfortunately not supported in all standard library implementations)
    * Workaround for [Abseil ABI issues](https://github.com/abseil/abseil-cpp/issues/1624)
    * Trivial update to `arrow/util/string.h` to call a C++20 API (to validate that C++20 is actually enabled)

3. CI configuration updates to get enough C++20 support on the various platforms:

    * Bump default clang and LLVM versions to 18
    * Use AlmaLinux 10 for release verification (AlmaLinux 8 is still tested on other CI builds)

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes, Arrow C++ will now require a C++20-compliant compiler.

* GitHub Issue: #45885

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2025-12-18 17:17:13 +01:00
Raúl Cumplido 719c32e2f1 GH-47806: [CI] Rename deprecated docker-compose.yml to preferred compose.yaml file (#47954)
### Rationale for this change

Docker Compose recommends `compose.yaml`:

https://docs.docker.com/compose/intro/compose-application-model/#the-compose-file

> The default path for a Compose file is compose.yaml (preferred) or compose.yml that is placed in the working directory. Compose also supports docker-compose.yaml and docker-compose.yml for backwards compatibility of earlier versions. If both files exist, Compose prefers the canonical compose.yaml.

### What changes are included in this PR?

- Update several `docker-compose.yml` file names to `compose.yaml`
- Update doc and comment references
- Update archery references to the file
- Update workflows and CODEOWNERS to take new file into account.

### Are these changes tested?

Yes via CI and some archery jobs.

### Are there any user-facing changes?

No

* GitHub Issue: #47806

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2025-10-28 09:54:55 +09:00
6a5db6105e GH-25025: [C++] Move non core compute kernels into separate shared library (#46261)
### Rationale for this change

Arrow is quite a heavy dependency and some users don't need all the tools we provide bundled with libarrow. Moving Arrow Compute to its own shared library allows users installations that better suit their needs having smaller memory footprint if necessary.
It might also help some users adding new kernels into an existing Arrow without recompiling it.

### What changes are included in this PR?

- Move all the Arrow Compute kernel functions to a new `ArrowCompute` shared library (`libarrow_compute.so`).
- Create a new API to Initialize arrow compute registering the existing Kernels into the `FunctionRegistry`
- Update Python/R/CGLib bindings to automatically register the Compute kernels transparently to the user.
- Update Linux Packaging to provide the new arrow-compute library.
- Update documentation with new requirements to call `arrow::compute::Initialize()`

### Are these changes tested?

Yes on all CI jobs.

### Are there any user-facing changes?

Yes. The Arrow compute functions will be provided as a different library. Any user using Arrow Compute from C++ directly will require a call to `arrow::compute::Initialize()` in order for the functions and kernels to be registered

**This PR includes breaking changes to public APIs.**

* GitHub Issue: #25025

Lead-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Bryce Mecum <petridish@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Rossi Sun <zanmato1984@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
2025-06-13 10:03:46 +02:00
fdd3e154aa GH-44950: [C++] Bump minimum CMake version to 3.25 (#44989)
### Rationale for this change

We want to upgrade our CMake version to 3.25 as discussed on the ML:
https://lists.apache.org/thread/h8jp16ktrj11fmjmjhlg6xvkvv9wzvjk

### What changes are included in this PR?

- Bump minimal CMake version to 3.25
- Manually install CMake on distributions where CMake < 3.25 was installed via package repositories
- Minor fixes to CI in order to have passing builds everywhere

### Are these changes tested?

Yes, via CI.

### Are there any user-facing changes?

Yes, the minimum CMake version to be used to build Arrow is bumped to 3.25.
**This PR includes breaking changes to build systems.**
* GitHub Issue: #44950

Lead-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Bryce Mecum <petridish@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2025-02-13 11:49:10 +09:00
Rossi Sun b74038235c GH-45219: [C++][Examples] Update examples to disable mimalloc (#45220)
### Rationale for this change

I think the intention was to disable the default allocator which used to be jemalloc. However since #44951 we have switched the default allocator from jemalloc to mimalloc. We should update the examples.

### What changes are included in this PR?

Change disabling jemalloc to disabling mimalloc for examples.

### Are these changes tested?

Manually tested.

### Are there any user-facing changes?

None.

* GitHub Issue: #45219

Authored-by: Rossi Sun <zanmato1984@gmail.com>
Signed-off-by: Rossi Sun <zanmato1984@gmail.com>
2025-01-10 13:38:58 +08:00
Mohammad LinjawiandSutou Kouhei ae497bf11a GH-44802: [C++][CI] Migrate to arrow::Result based parquet::arrow::OpenFile() API in example tutorials (#44807)
### Rationale for this change
This PR address this [issue](https://github.com/apache/arrow/issues/44802) and updates the `example-cpp-tutorial` in Crossbow to resolve build failures caused by deprecated APIs, as seen in [this CI job](https://github.com/ursacomputing/crossbow/actions/runs/11944262092/job/33294899404). The change migrates the examples to non-deprecated APIs to ensure compatibility with the latest Arrow C++ version.

Updating these APIs is necessary to:

Fix build failures and prevent future issues.
Align with the current Arrow C++ API.

### What changes are included in this PR?

This PR updates the example-cpp-tutorial to replace deprecated Arrow C++ APIs with the latest supported APIs, resolving build failures in the Crossbow night build.

### Are these changes tested?

By running: 
```
$ cd arrow/cpp/examples/tutorial_examples
$ docker compose run --rm tutorial
```

output:
```==
== Running example project
==

Day:   [
    1,
    12,
    17,
    23,
    28
  ]
Month:   [
    1,
    3,
    5,
    7,
    1
  ]
Year:   [
    1990,
    2000,
    1995,
    2000,
    1995
  ]
Day: int8
Month: int8
Year: int16
----
Day:
  [
    [
      1,
      12,
      17,
      23,
      28
    ],
    [
      6,
      12,
      3,
      30,
      22
    ]
  ]
Month:
  [
    [
      1,
      3,
      5,
      7,
      1
    ],
    [
      5,
      4,
      11,
      3,
      2
    ]
  ]
Year:
  [
    [
      1990,
      2000,
      1995,
      2000,
      1995
    ],
    [
      1980,
      2001,
      1915,
      2020,
      1996
    ]
  ]
Datum kind: Scalar(12891) content type: int64
12891
Datum kind: ChunkedArray([
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]) content type: int32
[
  [
    75376,
    647,
    2287,
    5671,
    5092
  ]
]
Datum kind: Scalar(2) content type: int64
2
Found fragment: parquet_dataset/data1.parquet
Partition expression: true
Found fragment: parquet_dataset/data2.parquet
Partition expression: true
a: int64
b: int64
c: int64
----
a:
  [
    [
      0,
      1,
      2,
      3,
      4
    ],
    [
      5,
      6,
      7,
      8,
      9
    ]
  ]
b:
  [
    [
      9,
      8,
      7,
      6,
      5
    ],
    [
      4,
      3,
      2,
      1,
      0
    ]
  ]
c:
  [
    [
      1,
      2,
      1,
      2,
      1
    ],
    [
      2,
      1,
      2,
      1,
      2
    ]
  ]

```

### Are there any user-facing changes?

Yes, the tutorial has been updated to use non-deprecated APIs, which may affect the example code provided to users.

* GitHub Issue: #44802

Lead-authored-by: Mohammad Linjawi <Mohammad.Linjawi@ibm.com>
Co-authored-by: Mohammad Linjawi <linjawi.mohammad@gmail.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2024-11-22 10:15:34 +09:00
Raúl CumplidoandSutou Kouhei 86b7a84c93 GH-37308: [C++][Docs] Change name for CPP tutorial and minor fixes to the job (#37311)
### Rationale for this change

Fix the job and rename so it's picked up as part of the nightlies

### What changes are included in this PR?

Rename + fixes to the job.

### Are these changes tested?

Via CI

### Are there any user-facing changes?

No
* Closes: #37308

Lead-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2023-08-25 10:29:15 +09:00
Sutou Kouhei 11b140a734 GH-34921: [C++][Python][Java] Require CMake 3.16 or later (#35921)
### Rationale for this change

We need to support Ubuntu 20.04 (CMake 3.16) or later, CentOS 7 (CMake 3.17) or later, and Debian GNU/Linux bullseye (CMake 3.18) or later.

So we can require CMake 3.16 or later.

### What changes are included in this PR?

Require CMake 3.16 or later.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: #34921

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2023-06-27 14:53:32 +09:00
Tamas Mate dcc15c9996 MINOR: [C++][Docs] Fix typo in Basic Arrow example (#15030)
This commit fixes a typo in the ChunkedArray construction section.

Authored-by: Tamas Mate <tmater@apache.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2022-12-20 05:36:56 +09:00
Kae S 8ad5e59803 ARROW-17377: [C++][Docs] Adds tutorial for basic Arrow, file access, compute, and datasets (#13859)
I intend for this PR to add a few small tutorial articles to the Arrow documentation, for basic Arrow usage, file access, compute, and dataset functionality. 

Right now, this is a draft PR, with just the code for the examples. Before I set it up with comments and prose in Sphinx, I wanted to get it reviewed. Do these examples seem suitable for the tutorials they target?

Authored-by: kaesuarez <kaesuarez1423@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
2022-09-20 18:27:45 -04:00