code: def test_boolean():
      import pyarrow.gandiva as gandiva
  
      table = pa.Table.from_arrays(
          [
              pa.array([1.0, 31.0, 46.0, 3.0, 57.0, 44.0, 22.0]),
              pa.array([5.0, 45.0, 36.0, 73.0, 83.0, 23.0, 76.0]),
          ],
          ["a", "b"],
      )
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      node_b = builder.make_field(table.schema.field("b"))
      fifty = builder.make_literal(50.0, pa.float64())
      eleven = builder.make_literal(11.0, pa.float64())
  
      cond_1 = builder.make_function(
          "less_than", [node_a, fifty], pa.bool_()
      )
      cond_2 = builder.make_function(
          "greater_than", [node_a, node_b], pa.bool_()
      )
      cond_3 = builder.make_function(
          "less_than", [node_b, eleven], pa.bool_()
      )
      cond = builder.make_or(
          [builder.make_and([cond_1, cond_2]), cond_3]
      )
      condition = builder.make_condition(cond)
  
      filter = gandiva.make_filter(table.schema, condition)
      result = filter.evaluate(
          table.to_batches()[0], pa.default_memory_pool()
      )
      assert result.to_array().equals(
          pa.array([0, 2, 5], type=pa.uint32())
      )
  
file_path: arrow/python/pyarrow/tests/test_gandiva.py
imports: import datetime
  import pytest
  import pyarrow
label_desc: Use image node_id 6 for calling a global function with example usage: test_boolean() without return types