| 40 | end |
| 41 | |
| 42 | def test_expressions |
| 43 | three_scalar = Arrow::Int8Scalar.new(3) |
| 44 | three_datum = Arrow::ScalarDatum.new(three_scalar) |
| 45 | expressions = [ |
| 46 | Arrow::FieldExpression.new("number"), |
| 47 | Arrow::CallExpression.new("multiply", |
| 48 | [ |
| 49 | Arrow::FieldExpression.new("number"), |
| 50 | Arrow::LiteralExpression.new(three_datum), |
| 51 | ]), |
| 52 | ] |
| 53 | options = Arrow::ProjectNodeOptions.new(expressions) |
| 54 | assert_equal(build_table("number" => [ |
| 55 | build_int8_array([1, 2, 3, 4, 5]), |
| 56 | ], |
| 57 | "multiply(number, 3)" => [ |
| 58 | build_int8_array([3, 6, 9, 12, 15]), |
| 59 | ]), |
| 60 | execute_plan(options)) |
| 61 | end |
| 62 | |
| 63 | def test_names |
| 64 | three_scalar = Arrow::Int8Scalar.new(3) |