Skip to content

[CALCITE-7580] Remove Gandiva dependency from Arrow adapter#4992

Open
caicancai wants to merge 3 commits into
apache:mainfrom
caicancai:calcite-7580-remove-gandiva
Open

[CALCITE-7580] Remove Gandiva dependency from Arrow adapter#4992
caicancai wants to merge 3 commits into
apache:mainfrom
caicancai:calcite-7580-remove-gandiva

Conversation

@caicancai
Copy link
Copy Markdown
Member

@caicancai caicancai commented Jun 4, 2026

https://issues.apache.org/jira/browse/CALCITE-7580

This removes the Arrow adapter's dependency on Gandiva.

The adapter now uses Arrow ValueVector reads for projection, and evaluates the current ArrowTranslator filter token subset in Java. This keeps the Arrow adapter correctness path in Java and avoids requiring the native Gandiva/LLVM runtime for Arrow adapter tests.

Changes:

  • remove arrow-gandiva from the Arrow module and BOM/version constraints;
  • remove Gandiva-based project/filter enumerators;
  • add a Java filter enumerator for the current Arrow filter token subset;
  • stop skipping Arrow tests based on Gandiva native library availability.

@caicancai caicancai marked this pull request as draft June 4, 2026 10:58
@caicancai caicancai force-pushed the calcite-7580-remove-gandiva branch 2 times, most recently from 8aefea7 to 3cc76fe Compare June 4, 2026 11:07
@caicancai caicancai marked this pull request as ready for review June 4, 2026 14:39
@caicancai caicancai requested a review from Copilot June 4, 2026 14:39
@caicancai caicancai marked this pull request as draft June 4, 2026 14:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the Arrow adapter’s dependency on the native Gandiva/LLVM runtime by switching projection to direct ValueVector reads and implementing evaluation of the existing Arrow filter token subset in pure Java, enabling Arrow adapter tests to run without platform-specific native libraries.

Changes:

  • Drop arrow-gandiva from version constraints, the BOM, and the Arrow module dependencies.
  • Remove Gandiva-based projector/filter enumerators and route filtering through a new Java-based filter enumerator.
  • Stop conditionally skipping Arrow tests based on Gandiva native library availability; keep filter token representation and translation aligned with the Java evaluator.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gradle.properties Removes the arrow-gandiva version property from global version constraints.
bom/build.gradle.kts Removes org.apache.arrow.gandiva:arrow-gandiva from the published BOM.
arrow/build.gradle.kts Drops the Arrow module’s direct dependency on arrow-gandiva.
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowExtension.java Removes Gandiva JNI load checks so Arrow tests are not skipped based on native availability.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ConditionToken.java Renames away from Gandiva terminology and introduces a typed Operator enum for filter tokens.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowTranslator.java Updates translation to emit typed operators and maintains the current supported operator subset.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowTable.java Removes Gandiva projector/filter construction and passes conditions through to Arrow enumerable for Java evaluation.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowRules.java Updates commentary to reflect Arrow adapter limitations rather than Gandiva-specific ones.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowProjectEnumerator.java Removes the Gandiva-based projection enumerator.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowJavaFilterEnumerator.java Adds Java evaluation of Arrow filter tokens using ValueVector reads.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowFilterEnumerator.java Removes the Gandiva-based filter enumerator.
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowEnumerable.java Switches enumeration to use the Java filter enumerator when conditions are present.
arrow/src/main/java/org/apache/calcite/adapter/arrow/AbstractArrowEnumerator.java Makes getValue reusable by the new Java filter enumerator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@caicancai caicancai force-pushed the calcite-7580-remove-gandiva branch 3 times, most recently from 7cdb4eb to b3c5c16 Compare June 4, 2026 15:32
@caicancai caicancai marked this pull request as ready for review June 4, 2026 15:58
@caicancai caicancai force-pushed the calcite-7580-remove-gandiva branch from b3c5c16 to 43ed745 Compare June 5, 2026 03:50
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown
Member

@xiedeyantu xiedeyantu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a note about this breaking change to history.md. I'm not very familiar with this area, but I've gone through the PR and the tests overall and it looks good to me. It would be great if someone with more expertise could help review it though.

.explainContains(plan);
}

@Test void testArrowProjectSkipsEmptyBatch() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better add the JIRA title here and other test cases.

/**
* Enumerator that evaluates Arrow filter tokens in Java.
*/
class ArrowJavaFilterEnumerator extends AbstractArrowEnumerator {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still call it ArrowFilterEnumerator? My understanding is that this PR is a breaking change upgrade. The same as ArrowProjectEnumerator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants