Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16088

Possible gandiva function problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 7.0.0
    • None
    • C++ - Gandiva
    • None
    • Aliyun ECS
      CentOS Linux release 7.9.2009 (Core)
      /arrow/cpp/src/gandiva/engine.cc:109: Detected CPU Name : skylake-avx512
      openjdk:8u322-jdk

    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?

      List<Field> 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<TreeNode> 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); 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wuyue_andrew wuyue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: