You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "felipepessoto (via GitHub)" <gi...@apache.org> on 2026/09/25 08:44:15 UTC

[PR] [CORE] Preserve original Java exceptions across JNI [gluten]

felipepessoto opened a new pull request, #13133:
URL: https://github.com/apache/gluten/pull/13133

   <!--
   Thank you for submitting a pull request! Here are some tips:
   
   1. For first-time contributors, please read our contributing guide:
      https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
   2. If necessary, create a GitHub issue for discussion beforehand to avoid duplicate work.
   3. If the PR is specific to a single backend, include [VL] or [CH] in the PR title to indicate the
      Velox or ClickHouse backend, respectively.
   4. If the PR is not ready for review, please mark it as a draft.
   -->
   
   ## What changes are proposed in this pull request?
   
   <!--
   Provide a clear and concise description of the changes introduced in this PR.
   Ensure the PR description aligns with the code changes, especially after updates.
   If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the corresponding issue
   when the PR is merged.
   -->
   
   Preserve the original Java throwable when a Java-backed native input iterator fails. Today `checkException` retains only its printed stack trace, Velox's generic native-exception handler can flatten it again, and `JNI_METHOD_END` constructs a message-only `GlutenException`. This loses the actual Java exception class, cause chain, and structured Spark error metadata.
   
   - Add the backend-neutral `gluten::JavaException(JNIEnv*, jthrowable)` carrier. A shared RAII global reference keeps the throwable alive across native exception copies and threads. Local references and diagnostic strings are released; cleanup attaches a thread only when necessary and does not detach a caller-owned JNI thread.
   - Capture callback exceptions through the existing `checkException` API and restore the same object with JNI `Throw`, before the existing native-exception fallback. An already-pending JNI allocation failure is not overwritten. Failure to describe the original exception does not replace it.
   - Wrap CPU and cuDF Java-backed input callbacks using Velox's existing `exception_ptr` constructor. Use a runtime wrapper so a failed Java callback is not treated as a suppressible `TRY` expression error. Recover Java carriers through Velox and standard nested wrappers at the output boundary, including lazy-vector loading. Other native errors are rethrown unchanged.
   - Add focused core reference-lifetime tests, Velox wrapper/lazy-output tests, and `GlutenJniExceptionSuite` under `gluten-ut` for real iterator/JNI identity, Spark metadata, nested callbacks, Errors, and diagnostic failures. Document the JNI exception contract.
   
   This is the generic transport fix only: no native cast-error classification, Delta assertion changes, or missing-error ARRAY/MAP changes. The original throwable is retained, not reconstructed from its message.
   
   ## How was this patch tested?
   
   <!--
   Describe how the changes were tested, if applicable.
   Include new tests to validate the functionality, if necessary.
   For UI-related changes, attach screenshots to demonstrate the updates.
   -->
   
   **Completed on Windows/WSL with isolated portable tooling:**
   
   - Compiled the actual `JavaException.cc` and `JavaExceptionTest.cc` with GCC 13, C++20, `-Wall -Wextra -Werror`: **7/7 tests passed**. Coverage includes shared lifetime, local/global reference accounting, detached-thread cleanup, already-attached thread ownership, describer/frame failures, and pending allocation errors.
   - Built an additional standalone JNI harness against the actual carrier and `JniExceptionDescriber`, then ran JDK 17 with `-Xcheck:jni`: **504 real JVM round trips passed**, checking original object/class/cause/suppressed exceptions/stack trace/custom structured metadata. Includes Java-caller and detached native-worker callbacks, concurrent calls, checked exceptions, Errors, a failing stack-trace describer, and normal return. This is generic JNI validation, not Spark/Velox integration.
   - `dev/format-cpp-code.sh` using clang-format **15.0.7**, followed by a dry-run check of the changed C++ files: passed.
   - Maven-wrapper Spotless apply/check scoped to `GlutenJniExceptionSuite.scala`, with Spark 3.5/Scala 2.12/backend profiles: passed.
   - Actual CI `.github/workflows/util/license-header.py` fix/check on all changed files: passed. `git diff --check`: passed.
   
   **Remaining verification / why this is a draft:**
   
   - Full native CMake configuration successfully detects the portable compiler, then stops because the pinned Velox checkout is absent (`ep/build-velox/build/velox_ep/scripts/setup-helper-functions.sh`). No full native dependency provisioning was started on the shared host.
   - Consequently, `velox_java_exception_test`, the full `gluten-ut`/Spark JNI suite, and the 40 affected Delta CI cases have **not** been executed. No claim is made that those 40 cases now pass.
   - The full `dev/format-scala-code.sh` was attempted but encounters a pre-existing Windows symlink-as-text file, `src-delta40/.../GlutenParquetFileFormat.scala`. The changed Scala suite passes scoped Spotless instead.
   - `dev/check.py header main --fix` was attempted but references the absent `dev/license-header.py`; the repository's actual CI license-header helper was used instead. Formatter-only changes outside this patch were removed; only the scoped implementation/tests/documentation are committed.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   
   Generated-by: GitHub Copilot 1.0.87-0 (GPT-6 Astra, model ID: gpt-6-astra)


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "zhztheplayer (via GitHub) via commits" <co...@gluten.apache.org>.
zhztheplayer commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6667329660

   @felipepessoto Thanks for the PR. Just curious Could the PR be also resolving the issue https://github.com/apache/gluten/issues/9642? 
   
   BTW it's a bit difficult to take a quick pass on the PR since it's over 1000 lines of additions. Do you think it's possible to split it into smaller ones?


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7199682483

   The revert PR: https://github.com/apache/gluten/pull/13812


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6549174092

   /delta-test


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6691015578

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-5835193027

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6539837152

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6641695768

   Hi, not sure who is the best person to review it, I'm tagging some reviewers: @zhztheplayer, @marin-ma, @zhouyuan, @rdtr. 
   
   Could you please review #13133? It preserves the original Java throwable across JNI/native execution instead of reducing it to text, retaining its type, cause chain, and Spark/Delta error metadata.
   
   I’d particularly appreciate feedback on JNI reference and thread lifetimes, exception propagation through Velox, and memory-reservation callbacks.
   
   Thanks.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub)" <gi...@apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-5829768775

   Regarding [the bot comment](https://github.com/apache/gluten/pull/13133#issuecomment-5829554532): this is the automatically generated ClickHouse x86 CI trigger, not a code-review request, so no code change is needed. The trigger workflow already completed successfully for `7e977538f`; I am avoiding a duplicate trigger and am not treating that workflow result as proof that the downstream tests passed.
   


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6541647094

   /delta-test


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7199879740

   > @felipepessoto No problem. Would suggest converting to draft next time when a PR is in progress
   
   Yeah, my bad. Thanks


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6697197802

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub)" <gi...@apache.org>.
felipepessoto closed pull request #13133: [CORE] Preserve original Java exceptions across JNI
URL: https://github.com/apache/gluten/pull/13133


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6549196074

   🔄 Delta Spark UT started by @felipepessoto (~2.5 h). [View run](https://github.com/apache/gluten/actions/runs/41242313066)


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6884139962

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7199658517

   Hi @zhztheplayer. This combined reference wasn't updated with the latest changes from https://github.com/apache/gluten/pull/13561.
   
   Can we quickly revert and merge #13561 instead?


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6541648206

   🔄 Delta Spark UT started by @felipepessoto (~2.5 h). [View run](https://github.com/apache/gluten/actions/runs/41188486128)


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6549164532

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "zhztheplayer (via GitHub) via commits" <co...@gluten.apache.org>.
zhztheplayer commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7199859986

   @felipepessoto No problem. Would suggest converting to draft next time when a PR is in progress


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "zhztheplayer (via GitHub) via commits" <co...@gluten.apache.org>.
zhztheplayer merged PR #13133:
URL: https://github.com/apache/gluten/pull/13133


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6535161262

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6539906971

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6549464540

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6675884519

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "zhztheplayer (via GitHub) via commits" <co...@gluten.apache.org>.
zhztheplayer commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7200029970

   > > @felipepessoto No problem. Would suggest converting to draft next time when a PR is in progress
   > 
   > Yeah, my bad. Thanks
   
   Not necessarily just because I am a lazy reviewer and not always going through the PR again before merging, Althought I am supposed to gather context torwards merging as well XD 


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6673654740

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "felipepessoto (via GitHub) via commits" <co...@gluten.apache.org>.
felipepessoto commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6678071593

   @zhztheplayer Thanks for taking a look. This addresses the Java -> C++ -> Java round trip mentioned in #9642, but not the full hybrid-stacktrace request. It restores the original Java throwable, including its type, cause, Java stack trace, and structured error metadata; it does not stitch the intervening C++ frames into that Java trace, so #9642 should remain open.
   
   Agreed on splitting this into smaller reviews. I'll separate it into three dependent changes, keeping the relevant regression tests with each one:
   
   1. Core JNI throwable transport, including global-reference lifetime/thread cleanup, diagnostic-allocation safety, and restoration at the JNI boundary.
   2. Velox iterator and lazy-output propagation, with Java/Spark metadata and Delta rejected-write regressions.
   3. Velox/Arrow memory-callback propagation, with reserve/unreserve and memory-metric regressions.
   
   CI is now green on `b25dc154c`: all 84 executed checks passed, including ClickHouse and the dedicated Delta run. I'll send the core change first, link the follow-ups here, and keep this PR available until the replacement work is ready.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "Copilot (via GitHub) via commits" <co...@gluten.apache.org>.
Copilot commented on code in PR #13133:
URL: https://github.com/apache/gluten/pull/13133#discussion_r4605641996


##########
gluten-ut/test/src-velox/test/scala/org/apache/spark/sql/execution/GlutenJniExceptionSuite.scala:
##########
@@ -0,0 +1,381 @@
+/*
+ * 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.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.gluten.backendsapi.BackendsApiManager
+import org.apache.gluten.config.GlutenConfig
+import org.apache.gluten.exception.GlutenException
+import org.apache.gluten.memory.{NativeMemoryManager, NativeMemoryManagerJniWrapper}
+import org.apache.gluten.memory.listener.ReservationListener
+import org.apache.gluten.memory.memtarget.Spiller
+import org.apache.gluten.runtime.{Runtime, RuntimeJniWrapper, Runtimes}
+import org.apache.gluten.substrait.`type`.{TypeBuilder, TypeNode}
+import org.apache.gluten.substrait.SubstraitContext
+import org.apache.gluten.substrait.expression.{ExpressionBuilder, ExpressionNode}
+import org.apache.gluten.substrait.plan.PlanBuilder
+import org.apache.gluten.substrait.rel.RelBuilder
+import org.apache.gluten.threads.NativeThreadManager
+import org.apache.gluten.utils.{BackendTestUtils, ConfigUtil}
+import org.apache.gluten.vectorized.{ColumnarBatchInIterator, ColumnarBatchOutIterator, NativePlanEvaluator, PlanEvaluatorJniWrapper}
+
+import org.apache.spark.{QueryContext, SparkArithmeticException, SparkConf, SparkNumberFormatException, SparkThrowable}
+import org.apache.spark.sql.GlutenQueryTest
+import org.apache.spark.sql.test.SharedSparkSession
+import org.apache.spark.sql.vectorized.{ColumnarBatch, ColumnVector}
+import org.apache.spark.task.TaskResources
+
+import java.io.PrintWriter
+import java.util.{Collections, Iterator => JIterator}
+
+import scala.collection.JavaConverters._
+
+class GlutenJniExceptionSuite extends GlutenQueryTest with SharedSparkSession {
+  override protected def sparkConf: SparkConf = {
+    super.sparkConf
+      .set("spark.plugins", "org.apache.gluten.GlutenPlugin")
+      .set("spark.default.parallelism", "1")
+      .set("spark.memory.offHeap.enabled", "true")
+      .set("spark.memory.offHeap.size", "1024MB")
+      .set("spark.ui.enabled", "false")
+      // TaskResources.runUnsafe uses stage -1, which would match the default dump stage.
+      .set(GlutenConfig.BENCHMARK_TASK_STAGEID.key, "0")
+  }
+
+  private def withNativeIterator(input: JIterator[ColumnarBatch])(
+      f: ColumnarBatchOutIterator => Unit): Unit = {
+    assume(BackendTestUtils.isVeloxBackendLoaded())
+    withTempDir {
+      spillDir =>
+        TaskResources.runUnsafe {
+          val context = new SubstraitContext
+          val names = Collections.singletonList("value")
+          val read = RelBuilder.makeReadRelForInputIterator(
+            Collections.singletonList(TypeBuilder.makeI32(false)),
+            names,
+            context,
+            context.nextOperatorId("exception-test"))
+          val plan = PlanBuilder.makePlan(context, Collections.singletonList(read), names)
+          val backend = BackendsApiManager.getBackendName
+          val out = NativePlanEvaluator
+            .create(backend)
+            .createKernelWithBatchIterator(
+              plan.toProtobuf.toByteArray,
+              Array.empty[Array[Byte]],
+              Array(new ColumnarBatchInIterator(backend, input)),
+              0,
+              spillDir.getCanonicalPath)
+          try {
+            out.noMoreSplits()
+            f(out)
+          } finally {
+            out.close()
+          }
+        }
+    }
+  }
+
+  private def failingInput(
+      original: Throwable,
+      failInHasNext: Boolean): JIterator[ColumnarBatch] = {
+    new JIterator[ColumnarBatch] {
+      override def hasNext: Boolean = {
+        if (failInHasNext) {
+          throw original
+        }
+        true
+      }
+
+      override def next(): ColumnarBatch = throw original
+    }
+  }
+
+  private def withReservationRuntime(listener: ReservationListener)(f: Runtime => Unit): Unit = {
+    TaskResources.runUnsafe {
+      val backend = BackendsApiManager.getBackendName
+      val threadOwner = Runtimes.contextInstance(backend, "jni-reservation-test")
+      val conf = ConfigUtil.serialize(
+        Map(
+          "spark.sql.session.timeZone" -> "UTC",
+          "spark.gluten.memory.backtrace.allocation" -> "false").asJava)
+      val memoryHandle = NativeMemoryManagerJniWrapper.create(backend, listener, conf)
+      try {
+        val runtimeHandle = RuntimeJniWrapper.createRuntime(
+          backend,
+          memoryHandle,
+          threadOwner.threadManager().getHandle(),
+          conf)
+        try {
+          val nativeMemory = new NativeMemoryManager {
+            override def addSpiller(spiller: Spiller): Unit =
+              throw new UnsupportedOperationException("This test does not install spillers")
+            override def hold(): Unit = NativeMemoryManagerJniWrapper.hold(memoryHandle)
+            override def getHandle(): Long = memoryHandle
+            override def release(): Unit = NativeMemoryManagerJniWrapper.release(memoryHandle)
+          }
+          f(new Runtime {
+            override def memoryManager(): NativeMemoryManager = nativeMemory
+            override def threadManager(): NativeThreadManager = threadOwner.threadManager()
+            override def getHandle(): Long = runtimeHandle
+          })
+        } finally {
+          RuntimeJniWrapper.releaseRuntime(runtimeHandle)
+        }
+      } finally {
+        NativeMemoryManagerJniWrapper.release(memoryHandle)
+      }
+    }
+  }
+
+  private def withNativeCount(runtime: Runtime)(f: ColumnarBatchOutIterator => Unit): Unit = {
+    withTempDir {
+      spillDir =>
+        val context = new SubstraitContext
+        val read = RelBuilder.makeReadRelForInputIterator(
+          Collections.emptyList[TypeNode](),
+          Collections.emptyList[String](),
+          context,
+          context.nextOperatorId("reservation-input"))
+        val count = ExpressionBuilder.makeAggregateFunction(
+          context.registerFunction("count"),
+          Collections.emptyList[ExpressionNode](),
+          "COMPLETE",
+          TypeBuilder.makeI64(false))
+        val aggregate = RelBuilder.makeAggregateRel(
+          read,
+          Collections.emptyList[ExpressionNode](),
+          Collections.singletonList(count),
+          Collections.singletonList[ExpressionNode](null),
+          null,
+          context,
+          context.nextOperatorId("reservation-aggregate")
+        )
+        val plan = PlanBuilder.makePlan(
+          context,
+          Collections.singletonList(aggregate),
+          Collections.singletonList("count"))
+        val input = new ColumnarBatch(Array.empty[ColumnVector], 1)
+        val handle = PlanEvaluatorJniWrapper
+          .create(runtime)
+          .nativeCreateKernelWithIterator(
+            plan.toProtobuf.toByteArray,
+            Array.empty[Array[Byte]],
+            Array(new ColumnarBatchInIterator(
+              BackendsApiManager.getBackendName,
+              Collections.singletonList(input).iterator())),
+            0,
+            0,
+            0L,
+            false,
+            spillDir.getCanonicalPath
+          )
+        val out = new ColumnarBatchOutIterator(runtime, handle)
+        try {
+          out.noMoreSplits()
+          f(out)
+        } finally {
+          out.close()
+          input.close()
+        }
+    }
+  }
+
+  private class FailingReservationListener(val original: RuntimeException)
+    extends ReservationListener {
+    var failReserve = false
+    var failUnreserve = false
+    var failures = 0
+    private var used = 0L
+
+    override def reserve(size: Long): Long = {
+      if (failReserve) {
+        failures += 1
+        throw original
+      }
+      used += size
+      size
+    }
+
+    override def unreserve(size: Long): Long = {
+      used -= size
+      if (failUnreserve) {
+        failures += 1
+        throw original
+      }
+      size
+    }
+
+    override def getUsedBytes: Long = used
+  }
+
+  for (failInHasNext <- Seq(true, false)) {
+    test(s"Java throwable identity and Spark metadata survive JNI (hasNext=$failInHasNext)") {
+      val errors = Seq(
+        new SparkArithmeticException(
+          "CAST_OVERFLOW",
+          Map(
+            "value" -> "128",
+            "sourceType" -> "\"INT\"",
+            "targetType" -> "\"TINYINT\"",
+            "ansiConfig" -> "\"spark.sql.ansi.enabled\""),
+          Array.empty[QueryContext],
+          ""
+        ),
+        new SparkNumberFormatException(
+          "CAST_INVALID_INPUT",
+          Map(
+            "expression" -> "'invalid'",
+            "sourceType" -> "\"STRING\"",
+            "targetType" -> "\"INT\"",
+            "ansiConfig" -> "\"spark.sql.ansi.enabled\""),
+          Array.empty[QueryContext],
+          ""
+        )
+      )
+      errors.foreach {
+        original =>
+          val cause = new IllegalStateException("original cause")
+          val suppressed = new IllegalArgumentException("original suppressed exception")
+          original.initCause(cause)
+          original.addSuppressed(suppressed)
+          val stack = original.getStackTrace.toSeq
+          val parameters = original.getMessageParameters
+          val errorClass = original.getErrorClass
+          val sqlState = original.getSqlState
+          withNativeIterator(failingInput(original, failInHasNext)) {
+            out =>
+              val actual = intercept[Exception] {
+                out.hasNext0()
+              }

Review Comment:
   When `failInHasNext=false`, `failingInput.hasNext` deterministically returns `true` and only `next()` throws. As written, the test always intercepts an exception from `out.hasNext0()` for both modes, which depends on non-obvious `ColumnarBatchOutIterator` prefetch behavior and can become flaky/incorrect if `hasNext0()` stops pulling `next()`. Consider making the failure site explicit: for `failInHasNext=true` assert the throw comes from `hasNext0()`, and for `false` first call `hasNext0()` (assert `true`), then intercept the throw from `next0()`.



##########
gluten-ut/test/src-velox/test/scala/org/apache/spark/sql/execution/GlutenJniExceptionSuite.scala:
##########
@@ -0,0 +1,381 @@
+/*
+ * 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.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.gluten.backendsapi.BackendsApiManager
+import org.apache.gluten.config.GlutenConfig
+import org.apache.gluten.exception.GlutenException
+import org.apache.gluten.memory.{NativeMemoryManager, NativeMemoryManagerJniWrapper}
+import org.apache.gluten.memory.listener.ReservationListener
+import org.apache.gluten.memory.memtarget.Spiller
+import org.apache.gluten.runtime.{Runtime, RuntimeJniWrapper, Runtimes}
+import org.apache.gluten.substrait.`type`.{TypeBuilder, TypeNode}
+import org.apache.gluten.substrait.SubstraitContext
+import org.apache.gluten.substrait.expression.{ExpressionBuilder, ExpressionNode}
+import org.apache.gluten.substrait.plan.PlanBuilder
+import org.apache.gluten.substrait.rel.RelBuilder
+import org.apache.gluten.threads.NativeThreadManager
+import org.apache.gluten.utils.{BackendTestUtils, ConfigUtil}
+import org.apache.gluten.vectorized.{ColumnarBatchInIterator, ColumnarBatchOutIterator, NativePlanEvaluator, PlanEvaluatorJniWrapper}
+
+import org.apache.spark.{QueryContext, SparkArithmeticException, SparkConf, SparkNumberFormatException, SparkThrowable}
+import org.apache.spark.sql.GlutenQueryTest
+import org.apache.spark.sql.test.SharedSparkSession
+import org.apache.spark.sql.vectorized.{ColumnarBatch, ColumnVector}
+import org.apache.spark.task.TaskResources
+
+import java.io.PrintWriter
+import java.util.{Collections, Iterator => JIterator}
+
+import scala.collection.JavaConverters._
+
+class GlutenJniExceptionSuite extends GlutenQueryTest with SharedSparkSession {
+  override protected def sparkConf: SparkConf = {
+    super.sparkConf
+      .set("spark.plugins", "org.apache.gluten.GlutenPlugin")
+      .set("spark.default.parallelism", "1")
+      .set("spark.memory.offHeap.enabled", "true")
+      .set("spark.memory.offHeap.size", "1024MB")
+      .set("spark.ui.enabled", "false")
+      // TaskResources.runUnsafe uses stage -1, which would match the default dump stage.
+      .set(GlutenConfig.BENCHMARK_TASK_STAGEID.key, "0")
+  }
+
+  private def withNativeIterator(input: JIterator[ColumnarBatch])(
+      f: ColumnarBatchOutIterator => Unit): Unit = {
+    assume(BackendTestUtils.isVeloxBackendLoaded())
+    withTempDir {
+      spillDir =>
+        TaskResources.runUnsafe {
+          val context = new SubstraitContext
+          val names = Collections.singletonList("value")
+          val read = RelBuilder.makeReadRelForInputIterator(
+            Collections.singletonList(TypeBuilder.makeI32(false)),
+            names,
+            context,
+            context.nextOperatorId("exception-test"))
+          val plan = PlanBuilder.makePlan(context, Collections.singletonList(read), names)
+          val backend = BackendsApiManager.getBackendName
+          val out = NativePlanEvaluator
+            .create(backend)
+            .createKernelWithBatchIterator(
+              plan.toProtobuf.toByteArray,
+              Array.empty[Array[Byte]],
+              Array(new ColumnarBatchInIterator(backend, input)),
+              0,
+              spillDir.getCanonicalPath)
+          try {
+            out.noMoreSplits()
+            f(out)
+          } finally {
+            out.close()
+          }
+        }
+    }
+  }
+
+  private def failingInput(
+      original: Throwable,
+      failInHasNext: Boolean): JIterator[ColumnarBatch] = {
+    new JIterator[ColumnarBatch] {
+      override def hasNext: Boolean = {
+        if (failInHasNext) {
+          throw original
+        }
+        true
+      }
+
+      override def next(): ColumnarBatch = throw original
+    }
+  }
+
+  private def withReservationRuntime(listener: ReservationListener)(f: Runtime => Unit): Unit = {
+    TaskResources.runUnsafe {
+      val backend = BackendsApiManager.getBackendName
+      val threadOwner = Runtimes.contextInstance(backend, "jni-reservation-test")
+      val conf = ConfigUtil.serialize(
+        Map(
+          "spark.sql.session.timeZone" -> "UTC",
+          "spark.gluten.memory.backtrace.allocation" -> "false").asJava)
+      val memoryHandle = NativeMemoryManagerJniWrapper.create(backend, listener, conf)
+      try {
+        val runtimeHandle = RuntimeJniWrapper.createRuntime(
+          backend,
+          memoryHandle,
+          threadOwner.threadManager().getHandle(),
+          conf)
+        try {
+          val nativeMemory = new NativeMemoryManager {
+            override def addSpiller(spiller: Spiller): Unit =
+              throw new UnsupportedOperationException("This test does not install spillers")
+            override def hold(): Unit = NativeMemoryManagerJniWrapper.hold(memoryHandle)
+            override def getHandle(): Long = memoryHandle
+            override def release(): Unit = NativeMemoryManagerJniWrapper.release(memoryHandle)
+          }
+          f(new Runtime {
+            override def memoryManager(): NativeMemoryManager = nativeMemory
+            override def threadManager(): NativeThreadManager = threadOwner.threadManager()
+            override def getHandle(): Long = runtimeHandle
+          })
+        } finally {
+          RuntimeJniWrapper.releaseRuntime(runtimeHandle)
+        }
+      } finally {
+        NativeMemoryManagerJniWrapper.release(memoryHandle)
+      }
+    }
+  }
+
+  private def withNativeCount(runtime: Runtime)(f: ColumnarBatchOutIterator => Unit): Unit = {
+    withTempDir {
+      spillDir =>
+        val context = new SubstraitContext
+        val read = RelBuilder.makeReadRelForInputIterator(
+          Collections.emptyList[TypeNode](),
+          Collections.emptyList[String](),
+          context,
+          context.nextOperatorId("reservation-input"))
+        val count = ExpressionBuilder.makeAggregateFunction(
+          context.registerFunction("count"),
+          Collections.emptyList[ExpressionNode](),
+          "COMPLETE",
+          TypeBuilder.makeI64(false))
+        val aggregate = RelBuilder.makeAggregateRel(
+          read,
+          Collections.emptyList[ExpressionNode](),
+          Collections.singletonList(count),
+          Collections.singletonList[ExpressionNode](null),
+          null,
+          context,
+          context.nextOperatorId("reservation-aggregate")
+        )
+        val plan = PlanBuilder.makePlan(
+          context,
+          Collections.singletonList(aggregate),
+          Collections.singletonList("count"))
+        val input = new ColumnarBatch(Array.empty[ColumnVector], 1)
+        val handle = PlanEvaluatorJniWrapper
+          .create(runtime)
+          .nativeCreateKernelWithIterator(
+            plan.toProtobuf.toByteArray,
+            Array.empty[Array[Byte]],
+            Array(new ColumnarBatchInIterator(
+              BackendsApiManager.getBackendName,
+              Collections.singletonList(input).iterator())),
+            0,
+            0,
+            0L,
+            false,
+            spillDir.getCanonicalPath
+          )
+        val out = new ColumnarBatchOutIterator(runtime, handle)
+        try {
+          out.noMoreSplits()
+          f(out)
+        } finally {
+          out.close()
+          input.close()
+        }
+    }
+  }
+
+  private class FailingReservationListener(val original: RuntimeException)
+    extends ReservationListener {
+    var failReserve = false
+    var failUnreserve = false
+    var failures = 0
+    private var used = 0L
+
+    override def reserve(size: Long): Long = {
+      if (failReserve) {
+        failures += 1
+        throw original
+      }
+      used += size
+      size
+    }
+
+    override def unreserve(size: Long): Long = {
+      used -= size
+      if (failUnreserve) {
+        failures += 1
+        throw original
+      }

Review Comment:
   `used` is decremented even when `unreserve` is configured to fail and throws. This makes `getUsedBytes` inconsistent with the simulated failure (and can hide or introduce false positives around accounting/metrics). Update the logic so `used` is only modified on success (or roll back the mutation before throwing).



##########
gluten-ut/test/src-velox/test/scala/org/apache/spark/sql/execution/GlutenJniExceptionSuite.scala:
##########
@@ -0,0 +1,381 @@
+/*
+ * 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.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.gluten.backendsapi.BackendsApiManager
+import org.apache.gluten.config.GlutenConfig
+import org.apache.gluten.exception.GlutenException
+import org.apache.gluten.memory.{NativeMemoryManager, NativeMemoryManagerJniWrapper}
+import org.apache.gluten.memory.listener.ReservationListener
+import org.apache.gluten.memory.memtarget.Spiller
+import org.apache.gluten.runtime.{Runtime, RuntimeJniWrapper, Runtimes}
+import org.apache.gluten.substrait.`type`.{TypeBuilder, TypeNode}
+import org.apache.gluten.substrait.SubstraitContext
+import org.apache.gluten.substrait.expression.{ExpressionBuilder, ExpressionNode}
+import org.apache.gluten.substrait.plan.PlanBuilder
+import org.apache.gluten.substrait.rel.RelBuilder
+import org.apache.gluten.threads.NativeThreadManager
+import org.apache.gluten.utils.{BackendTestUtils, ConfigUtil}
+import org.apache.gluten.vectorized.{ColumnarBatchInIterator, ColumnarBatchOutIterator, NativePlanEvaluator, PlanEvaluatorJniWrapper}
+
+import org.apache.spark.{QueryContext, SparkArithmeticException, SparkConf, SparkNumberFormatException, SparkThrowable}
+import org.apache.spark.sql.GlutenQueryTest
+import org.apache.spark.sql.test.SharedSparkSession
+import org.apache.spark.sql.vectorized.{ColumnarBatch, ColumnVector}
+import org.apache.spark.task.TaskResources
+
+import java.io.PrintWriter
+import java.util.{Collections, Iterator => JIterator}
+
+import scala.collection.JavaConverters._

Review Comment:
   `scala.collection.JavaConverters._` is deprecated on Scala 2.13+ (replaced by `scala.jdk.CollectionConverters._`). If this test source is compiled under Spark/Scala 2.13 (e.g., Spark 4.x builds), this can introduce deprecation noise or failures if warnings are treated strictly. Consider switching to `scala.jdk.CollectionConverters._` where supported, or using the project’s existing cross-Scala compatibility pattern for collection converters.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6960723854

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "zhztheplayer (via GitHub) via commits" <co...@gluten.apache.org>.
zhztheplayer commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-7200198028

   > Not necessarily just because I am a lazy reviewer and not always going through the PR again before merging, Althought I am supposed to gather context torwards merging as well XD
   
   Yeah, my bad just found I merged the wrong PR, so let's use draft next time so it helps reviewer make fewer mistakes.


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-5829554532

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-5836263951

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-5836747167

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6537097221

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Preserve original Java exceptions across JNI (combined reference) [gluten]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@gluten.apache.org>.
github-actions[bot] commented on PR #13133:
URL: https://github.com/apache/gluten/pull/13133#issuecomment-6883454829

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org