code: def test_regex():
      import pyarrow.gandiva as gandiva
  
      elements = ["park", "sparkle", "bright spark and fire", "spark"]
      data = pa.array(elements, type=pa.string())
      table = pa.Table.from_arrays([data], names=["a"])
  
      builder = gandiva.TreeExprBuilder()
      node_a = builder.make_field(table.schema.field("a"))
      regex = builder.make_literal("%spark%", pa.string())
      like = builder.make_function("like", [node_a, regex], pa.bool_())
  
      field_result = pa.field("b", pa.bool_())
      expr = builder.make_expression(like, field_result)
  
      projector = gandiva.make_projector(
          table.schema, [expr], pa.default_memory_pool()
      )
  
      (r,) = projector.evaluate(table.to_batches()[0])
      b = pa.array([False, True, True, True], type=pa.bool_())
      assert r.equals(b)
  
file_path: arrow/python/pyarrow/tests/test_gandiva.py
imports: import datetime
  import pytest
  import pyarrow
label_desc: Use image node_id 8 for calling a global function with example usage: test_regex() without return types