Skip to content

Tomnewton/make cache options configurable from python/gh 36441 - #1

Closed
Tom-Newton wants to merge 49 commits into
mainfrom
tomnewton/make_cache_options_configurable_from_python/GH-36441
Closed

Tom-Newton wants to merge 49 commits into
mainfrom
tomnewton/make_cache_options_configurable_from_python/GH-36441

Conversation

@Tom-Newton

Copy link
Copy Markdown
Owner

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

kou and others added 21 commits July 7, 2023 11:50
…a, filtered_schema) (apache#36533)

### Rationale for this change

The current `arrow::ipc::Listener::OnSchemaDecoded()` receives only the original schema. But we have filtered schema in decode phase. Filtered schema is useful for some cases. So we should pass the filtered schema too.

### What changes are included in this PR?

This adds `arrow::ipc::Listener::OnSchemaDecoded(schema, filtered_schema)`. The default implementation of it just calls `OnSchemaDecoded(schema)` to keep backward compatibility.

This also adds `arrow::ipc::CollectListener::filtered_schema()`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#36407

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Benjamin Kietzman <[email protected]>
…ache#36559)

### Rationale for this change

Arrow introduced a `Result` return object that can be used in place of passing output parameters. Most of Flight has already been migrated. 

### Are these changes tested?

C++ tests pass, which involve the sqlite and acero example servers. Any other testing we would like to see?

```
100% tests passed, 0 tests failed out of 84

Label Time Summary:
arrow-tests         = 168.18 sec*proc (35 tests)
arrow_acero         = 106.32 sec*proc (12 tests)
arrow_compute       =  76.46 sec*proc (13 tests)
arrow_dataset       =  78.09 sec*proc (12 tests)
arrow_flight        = 123.81 sec*proc (2 tests)
arrow_flight_sql    =  19.29 sec*proc (1 test)
filesystem          =  10.39 sec*proc (2 tests)
parquet-tests       =  55.24 sec*proc (9 tests)
unittest            = 627.40 sec*proc (84 tests)

Total Test time (real) = 120.83 sec
```

### Are there any user-facing changes?

Yes. The protected methods DoPut, DoGet, and DoAction for the SQL client have been updated. DoGet already exposed a public API and that has been updated to be virtual.
* Closes: apache#31521

Authored-by: Dane Pitkin <[email protected]>
Signed-off-by: David Li <[email protected]>
… no pandas installed (don't install doc requirements in conda-python image) (apache#36542)

### Rationale for this change

The "Without Pandas" CI build is actually having pandas installed and thus not testing the case of an environment without pandas. 

* Closes: apache#36541

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…apache#36545)

Added/updated some init methods to public access for public class so these classes can be instantiated outside of the arrow package.
* Closes: apache#36544

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…cython or cpp) is not built (apache#36554)

### Rationale for this change

Improving the error message when a submodule is not built (by catching the ImportError and re-raising it reworded)

* Closes: apache#36553

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Our Conda environment file was pinning the AWS SDK to a rather old version. We should update to a more recent one.

We still pin to a specific version because the AWS SDK releases very often and we don't want to suffer occasional regressions from upstream.

Lead-authored-by: Antoine Pitrou <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…pache#36576)

### Rationale for this change

Because we don't need to run GDB plugin test for the build.

### What changes are included in this PR?

Specify `-g1` explicitly.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#36543

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…ckage() (apache#36581)

### Rationale for this change

We don't need to use `try_compile()` by using gRPC version detected by `find_package()`.

### What changes are included in this PR?

Use  gRPC version detected by `find_package()`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#36479

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…es (apache#36583)

### Rationale for this change

Most Homebrew formulae use OpenSSL v3 for now.

### What changes are included in this PR?

Backport the latest formulae changes including OpenSSL version change.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#36582

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
This removes some redundant code by moving the adding of threads to grpc link libs outside of the if()

Lead-authored-by: Jacob Wujciak-Jens <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…ngFactory objects (apache#36550)

### Rationale for this change

apache#36462 already added support for pickling Partitioning objects, but not yet the PartitioningFactory objects.

The problem for PartitioningFactory is that we currently don't really expose the full class hierarchy in python, just the base class PartitioningFactory. We also don't expose creating those factory objects, except through the `discover` methods of the Partitioning classes. 
I think it would be nice to keep this minimal binding, but that means if we want to make them serializable with pickle, we need another way to do that (and if we don't want to add custom code for serialization on the C++ side). 

In this PR, I went for the route of essentially storing the constructor (the discover static method) and the arguments that were passed to the constructor, on the factory object, so we can use this info for pickling. Not the nicest code, but the simplest solution I could think of.

### Are these changes tested?

Yes
* Closes: apache#34884

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
…pache#36536)

It is counter-intuitive, but lock ordering issues can happen even with a shared mutex locked in shared mode.
The reason is that locking again in shared mode can block while there are threads waiting to take the lock in exclusive mode. For this reason, we must avoid to keep the S3ClientLock taken before is it taken again.

* Closes: apache#36523

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
….to_numpy (apache#35582)

### Rationale for this change

Addresses apacheGH-34787.

### What changes are included in this PR?

I think this proposes the minimal viable changes to have the same signature as proposed in apacheGH-34787.

### Are these changes tested?

Yes, for now, a single simple test has been introduced to test the correct behavior of `ChunkedArray.to_numpy` with respect to the addition of `zero_copy_only`.

* Closes: apache#34787

Lead-authored-by: Julien Jerphanion <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
…heGH-33321 (apache#36586)

See https://github.com/apache/arrow/pull/35656/files#r1257540254

apache#36542 fixed the no-pandas build by actually not having pandas installed, but some PRs merged at the same time introduced new failures for this build.
* Closes: apache#36541

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
### Rationale for this change

Enable local search of pkgdown site.

### What changes are included in this PR?

Remove some files that are not currently in use.

### Are these changes tested?

There is no test, but the following functions can be run to verify that the site is working properly.

```r
pkgdown::init_site("r")
pkgdown::build_search("r")
pkgdown::build_home("r")
```

### Are there any user-facing changes?

No. Document changes only.
* Closes: apache#14969

Authored-by: SHIMA Tatsuya <[email protected]>
Signed-off-by: Nic Crane <[email protected]>
…packages (apache#36578)

### Rationale for this change

We want to consciously upgrade major versions for `Microsoft.Bcl.*`, `Microsoft.Extensions.*` and `System.*`.

### What changes are included in this PR?

Use `version-update:semver-major` for them.

### Are these changes tested?

No. I want to test this on main.

### Are there any user-facing changes?

No.
* Closes: apache#36577

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Eric Erhardt <[email protected]>
…row.array.<Numeric>Array` constructors (apache#36561)

### Rationale for this change

We initially added the `DeepCopy` name-value pair to the numeric array class constructors for testing purposes. When `DeepCopy=true`, the proxy classes copy the data from the MATLAB array when creating the underlying `std::shared_ptr<arrow::NumericArray<CType>>`. By default, we don't make a copy and instead store the original array as a property named `MatlabArray`. Doing so keeps the backing memory of the arrow array alive and avoids a copy.

### What changes are included in this PR?
`DeepCopy` is no longer accepted as a name-value pair by the constructors of the numeric array classes. 

### Are these changes tested?
No tests were needed.

### Are there any user-facing changes?

This is technically a user facing change, but the MATLAB interface is still experimental and under active development. We don't expect anyone to be affected by this change.

* Closes: apache#36560

Authored-by: Sarah Gilmore <[email protected]>
Signed-off-by: Kevin Gurney <[email protected]>
### Rationale for this change

I'm reviewing MATLAB/Swift related PRs because there are not enough committers for them for now.

### What changes are included in this PR?

Add me to MATLAB/Swift.

### Are these changes tested?

No.

### Are there any user-facing changes?

No.

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
…API (apache#36290)

### Rationale for this change

Support `write_page_index` in Parquet Python API

### What changes are included in this PR?

support `write_page_index` in properties

### Are these changes tested?

Currently not

### Are there any user-facing changes?

User can generate page index here.

* Closes: apache#36284

Lead-authored-by: mwish <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Co-authored-by: mwish <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
…36600)

### Rationale for this change

We recently made some improvements to `libmexclass` that include creating a class named `libmexclass.proxy.Identifier` which represents proxy ids. This class will be helpful when we create `arrowy.array.Array` objects from existing proxy ids, which used to be represented as scalar `uint64` values.

### What changes are included in this PR?

1. Bumps the libmexclass version the MATLAB Interface depends on to [#3465900](mathworks/libmexclass@3465900) 

### Are these changes tested?

No tests needed.

### Are there any user-facing changes?

No.

* Closes: apache#36599

Authored-by: Sarah Gilmore <[email protected]>
Signed-off-by: Kevin Gurney <[email protected]>
@Tom-Newton
Tom-Newton force-pushed the tomnewton/make_cache_options_configurable_from_python/GH-36441 branch from 6fb53a2 to 4f5eabb Compare July 10, 2023 18:37
zeroshade and others added 8 commits July 10, 2023 16:25
### Rationale for this change
While trying to fix an issue with Snowflake ADBC timestamp handling, I came across this as part of the problem.

### What changes are included in this PR?
Adds the timezone string indicator to the output of `ValueStr` for a timestamp array.

* Closes: apache#36568

Authored-by: Matt Topol <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
### Rationale for this change

We already have the "Component: Swift" label but it's not added to Swift related PRs automatically.

### What changes are included in this PR?

Add a configuration for labeler.

### Are these changes tested?

No. I want to test this on main.

### Are there any user-facing changes?

No.
* Closes: apache#36570

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…ache#36526)

Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.12.1 to 0.13.5.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/ec962b0bd6854c991d7a3ebd77037579165acb36"><code>ec962b0</code></a> Set library version: 0.13.5</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/e2593ccbc8d81beeaa3aebafd41394a317721c04"><code>e2593cc</code></a> Prepare v0.13.5 changelog</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/9e88e47a63836132ae1f8a0d816a9c21b83d7878"><code>9e88e47</code></a> bump SDK version to pick up .NET Runtime fix that should fix disassembler tes...</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/f76c6829826518f43b4e79d26d34a2133109bd61"><code>f76c682</code></a> Introduce MockToolchain (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2178">#2178</a>)</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/59e17fc30b85439072dd070007a308be9fe67c18"><code>59e17fc</code></a> Bump Cake: 2.0.0-&gt;3.0.0 (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2267">#2267</a>)</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/ff5dbe662478f547e4be8d734eaeb6a106f40875"><code>ff5dbe6</code></a> Don't hold onto references in Consumer (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2191">#2191</a>)</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/d3fbc03d6dabeb52f23c6b7e50287150e66957cc"><code>d3fbc03</code></a> Keep generated files when MSBuild bin log is requested (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2254">#2254</a>)</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/615384d2553434d7f35c03ab3174d761f82c6c2d"><code>615384d</code></a> Removed deprecated InProcessToolchain. (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2248">#2248</a>)</li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/5cd288996ca13292fcf638be299c097a600aea7b"><code>5cd2889</code></a> Enabled strong-named assemblies on all OS, fix <a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2258">#2258</a></li>
<li><a href="https://github.com/dotnet/BenchmarkDotNet/commit/512413ceb24077154bdf6d6306138accffe64c7a"><code>512413c</code></a> Add JitStatsDiagnoserAttribute (<a href="https://redirect.github.com/dotnet/BenchmarkDotNet/issues/2250">#2250</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/dotnet/BenchmarkDotNet/compare/v0.12.1...v0.13.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=BenchmarkDotNet&package-manager=nuget&previous-version=0.12.1&new-version=0.13.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@ dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@ dependabot rebase` will rebase this PR
- `@ dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@ dependabot merge` will merge this PR after your CI passes on it
- `@ dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@ dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@ dependabot reopen` will reopen this PR if it is closed
- `@ dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@ dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@ dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@ dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Sutou Kouhei <[email protected]>
### Rationale for this change

Use the cache of `test` to reduce test time.

### What changes are included in this PR?

Use `jest` cache with `actions/cache@ v3`.

### Are these changes tested?

In GitHub Actions, test time was reduced.

### Are there any user-facing changes?

* Closes: apache#36154

Authored-by: abetomo <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
…apache#36575)

### Rationale for this change

The default value for the `SliceOptions::stop` is `INT64_MAX`, which isn't considered in several internal calculations - resulting in integer overflows and unexpected behavior when `stop` isn't provided.

Also note that running the included tests without the fixes should result in ubsan errors (it did for me, at least).

### What changes are included in this PR?

- Adds some logic to `SliceCodunitsTransform` that handles potential overflows
- Adds tests for cases where the `start` param is positive/negative and `stop` is the maximum value

**Update**
Discovered that `utf8_slice_codeunits` deviates from Python array behavior when `stop=None` and `step < 0`, so further changes were made:
- Handles `INT64_MIN` for `SliceOptions::stop` on C++ side, adds more tests.
- Updates Python bindings for `SliceOptions` so that the default value when `stop=None` (`sys.maxsize`) is negated when `step < 0`
- Adds `None` as a possible `stop` value in Python tests

### Are these changes tested?

Yes (tests are included)

### Are there any user-facing changes?

In theory, altering the behavior of `utf8_slice_codepoints` when `stop=None` and `step < 0` could be considered a breaking change. That being said, the current implementation produces incorrect results whenever `None` is even used, so it probably isn't one in practice...

* Closes: apache#36311

Authored-by: benibus <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
ArraySpan contained scratch space inside itself for storing offsets when viewing a scalar as a length=1 array. This could lead to dangling pointers in copies of the ArraySpan since copies' pointers will always refer to the original's scratch space, which may have been destroyed.

This patch moves that scratch space into Scalar itself, which is more conformant to the contract of a view since the scratch space will be valid as long as the Scalar is alive, regardless of how ArraySpans are copied.
* Closes: apache#35581

Authored-by: Benjamin Kietzman <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
### Rationale for this change

basic_string_view was never really intended to support types other than chars; the template which the STL intends for use in this situation is std::span 

### What changes are included in this PR?

Since std::span is added in c++20, a minimal polyfill is added named util::span.
- doesn't include support for static extents
- some accessors like `front()` are not present in util::span

### User facing changes:

- The broken alias bytes_view and its header are removed. I don't expect this to trouble anybody much since it isn't used in much of our API, and if it's really necessary it will be trivial to add it back with `using bytes_view = span<uint8_t const>;` or so

* Closes: apache#15281

Lead-authored-by: Benjamin Kietzman <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
AlenkaF and others added 4 commits July 11, 2023 15:50
### Rationale for this change

Not being able to respond to most of the review notifications that affect the python part also.

### What changes are included in this PR?

Remove myself from the `python` component

Authored-by: Alenka Frim <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
…ression parameter (apache#35886)

### Rationale for this change

Based on apache#35287, we'd like to add a CodecOptions to make more compression parameters (such as window_bits) customizable when creating the Codec for parquet writer.

Authored-by: Yang Yang [yang10.yang@ intel.com](mailto:yang10.yang@ intel.com)
Co-authored-by: Rambacher, Mark [mark.rambacher@ intel.com](mailto:mark.rambacher@ intel.com)

### What changes are included in this PR?

Add CodecOptions and replace `compression_level` when creating the Codec. The design is basically based on previous discussions. 
### Are these changes tested?

Yes
### Are there any user-facing changes?

Yes, when user creates the `WriterProperties`

* Closes: apache#35287

Lead-authored-by: yyang52 <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
apache#36617)

We want to make sure that the error description payload for ARROW_CHECK is only evaluated if the check fails.

* Closes: apache#36618

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
…ByteRanges (apache#36521)

### Rationale for this change

Fix for apache#36502.

### What changes are included in this PR?

Fix and C++ tests.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Addition of a new function to the `ree_util` namespace.
* Closes: apache#36502

Lead-authored-by: Felipe Oliveira Carvalho <[email protected]>
Co-authored-by: Benjamin Kietzman <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@Tom-Newton
Tom-Newton force-pushed the tomnewton/make_cache_options_configurable_from_python/GH-36441 branch 2 times, most recently from 25b2e78 to 32646ef Compare July 11, 2023 22:21
kou and others added 3 commits July 12, 2023 09:17
…ache#36606)

### Rationale for this change

There are 2 problems:

* `FindProtobuf.cmake` provided by CMake is incomplete with Protobuf 23.4.
* Misses `-DPROTOBUF_USE_DLLS` for building Substrait related files.

### What changes are included in this PR?

* We need to use `protobuf-config.cmake` provided by Protobuf instead of `FindProtobuf.cmake` provided by CMake because `FindProtobuf.cmake` misses `absl::status` dependency.
* Accept Protobuf 23.4.
* Use `PROTOBUF_USE_DLLS` when we build Substrait related files.
* Use `Boost_INCLUDE_DIRS` instead of `Boost_INCLUDE_DIR` because `Boost_INCLUDE_DIR` isn't defined in `BoostConfig.cmake`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#36598

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@Tom-Newton
Tom-Newton force-pushed the tomnewton/make_cache_options_configurable_from_python/GH-36441 branch from 4eb815a to a4fc380 Compare July 12, 2023 08:37
@Tom-Newton
Tom-Newton force-pushed the tomnewton/make_cache_options_configurable_from_python/GH-36441 branch from a4fc380 to e7bf8a9 Compare July 12, 2023 08:38
@Tom-Newton Tom-Newton closed this Jul 12, 2023
Tom-Newton pushed a commit that referenced this pull request Jan 14, 2025
…n timezone (apache#45051)

### Rationale for this change

If the timezone database is present on the system, but does not contain a timezone referenced in a ORC file, the ORC reader will crash with an uncaught C++ exception.

This can happen for example on Ubuntu 24.04 where some timezone aliases have been removed from the main `tzdata` package to a `tzdata-legacy` package. If `tzdata-legacy` is not installed, trying to read a ORC file that references e.g. the "US/Pacific" timezone would crash.

Here is a backtrace excerpt:
```
#12 0x00007f1a3ce23a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f1a3ce39391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
apache#14 0x00007f1a3f4accc4 in orc::loadTZDB(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#15 0x00007f1a3f4ad392 in std::call_once<orc::LazyTimezone::getImpl() const::{lambda()#1}>(std::once_flag&, orc::LazyTimezone::getImpl() const::{lambda()#1}&&)::{lambda()#2}::_FUN() () from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#16 0x00007f1a4298bec3 in __pthread_once_slow (once_control=0xa5ca7c8, init_routine=0x7f1a3ce69420 <__once_proxy>) at ./nptl/pthread_once.c:116
apache#17 0x00007f1a3f4a9ad0 in orc::LazyTimezone::getEpoch() const ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#18 0x00007f1a3f4e76b1 in orc::TimestampColumnReader::TimestampColumnReader(orc::Type const&, orc::StripeStreams&, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#19 0x00007f1a3f4e84ad in orc::buildReader(orc::Type const&, orc::StripeStreams&, bool, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#20 0x00007f1a3f4e8dd7 in orc::StructColumnReader::StructColumnReader(orc::Type const&, orc::StripeStreams&, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#21 0x00007f1a3f4e8532 in orc::buildReader(orc::Type const&, orc::StripeStreams&, bool, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#22 0x00007f1a3f4925e9 in orc::RowReaderImpl::startNextStripe() ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#23 0x00007f1a3f492c9d in orc::RowReaderImpl::next(orc::ColumnVectorBatch&) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#24 0x00007f1a3e6b251f in arrow::adapters::orc::ORCFileReader::Impl::ReadBatch(orc::RowReaderOptions const&, std::shared_ptr<arrow::Schema> const&, long) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
```

### What changes are included in this PR?

Catch C++ exceptions when iterating ORC batches instead of letting them slip through.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40633

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.