augustoasilva commented on a change in pull request #11166: URL: https://github.com/apache/arrow/pull/11166#discussion_r745151213
########## File path: cpp/src/gandiva/tests/projector_test.cc ########## @@ -1606,4 +1606,46 @@ TEST_F(TestProjector, TestCastNullableIntYearInterval) { EXPECT_ARROW_ARRAY_EQUALS(out_int64, outputs.at(1)); } +TEST_F(TestProjector, TestEltFunction) { + auto field0 = field("f0", arrow::int32()); + auto field1 = field("f1", arrow::utf8()); + auto field2 = field("f2", arrow::utf8()); + + auto schema0 = arrow::schema({field0, field1, field2}); + + // output fields + auto out_field0 = field("out_field0", arrow::utf8()); + + // Build expression + auto elt_expr0 = + TreeExprBuilder::MakeExpression("elt", {field0, field1, field2}, out_field0); + + std::shared_ptr<Projector> projector1; + + auto status = Projector::Make(schema0, {elt_expr0}, TestConfiguration(), &projector1); + EXPECT_TRUE(status.ok()); + + // Create a row-batch with some sample data + int num_records = 5; + + auto array0 = MakeArrowArrayInt32({1, 2, 4, 0, -2}, {true, true, true, true, true}); Review comment: yeah, I wrote the first test case. Now I added cases for the fixed pos where the first one grabs the pos 1 with first vector containing the bigger words, and seconde case where pos is 2 and the second vector has the smaller words. Is that what you meant? -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org