apache / apache/arrow

Possible gandiva function problem

Open
#31,500 1 comment 0 reactions 0 assignees View on GitHub
Component: Gandiva Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

I use Gandiva JNI  and function greater_than_or_equal_to is not support.

Is it really not support or i use it in a wrong way?
```java

List fields = new ArrayList<>();
Field idF = new Field("id", new FieldType(false, new ArrowType.Int(8, false), null), null);
fields.add(idF);
fields.add(new Field("name", new FieldType(false, new ArrowType.Utf8(), null), null));
Schema schema = new Schema(fields);

RootAllocator allocator = new RootAllocator(Long.MAX_VALUE);
VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator);
root.getFieldVectors().forEach(vec -> vec.setInitialCapacity(100));
root.allocateNew();

root.getFieldVectors().forEach(fv -> {
if (fv instanceof IntVector) {
for (int i = 0; i < 100; i++) {
((IntVector) fv).setSafe(i, i);
}
}
if (fv instanceof VarCharVector) {
for (int i = 0; i < 100; i++) {
((VarCharVector) fv).setSafe(i, String.valueOf(i + 100).getBytes());
}
}
});

List list = new ArrayList<>();
TreeNode idNode = TreeBuilder.makeField(idF);
TreeNode literalNode = TreeBuilder.makeLiteral(50);
TreeNode eqNode = TreeBuilder.makeFunction("greater_than_or_equal_to", list, new ArrowType.Bool());
Condition condition = TreeBuilder.makeCondition(eqNode);
Filter filter = Filter.make(root.getSchema(), condition);

ArrowBuf selectionBuffer = allocator.buffer(200);
SelectionVectorInt16 selectionVector = new SelectionVectorInt16(selectionBuffer);

ArrowRecordBatch data = new VectorUnloader(root).getRecordBatch();
filter.evaluate(data, selectionVector);
```
 

**Environment**: Aliyun ECS
CentOS Linux release 7.9.2009 (Core)
/arrow/cpp/src/gandiva/engine.cc:109: Detected CPU Name : skylake-avx512
openjdk:8u322-jdk
**Reporter**: [wuyue](https://issues.apache.org/jira/browse/ARROW-16088)

**Note**: *This issue was originally created as [ARROW-16088](https://issues.apache.org/jira/browse/ARROW-16088). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Java Gandiva JNI example and inspect the reported /arrow/cpp/src/gandiva/engine.cc entry point alongside the function evaluation path. Confirm whether greater_than_or_equal_to is supported and whether the shown expression construction is valid; done means a verified result or a precise usage correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.