vvellanki commented on a change in pull request #11166:
URL: https://github.com/apache/arrow/pull/11166#discussion_r744835348
##########
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:
You wrote this test - I meant changing the value of pos such that it
returns the input of smallest length; input of largest length and a random
input string... I believe you wrote this test.
The other test was where pos is a constant (1 for e.g.) and the first vector
had the larger inputs than the 2nd vector; and another test where pos is a
constant (2 for e.g.) and the 2nd vector had the smaller input
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]