code: def test_scan(tempdir):
      table = pa.table({"a": [1, 2, 3], "b": [4, 5, 6]})
      ds.write_dataset(table, tempdir / "dataset", format="parquet")
      dataset = ds.dataset(tempdir / "dataset", format="parquet")
      decl = Declaration("scan", ScanNodeOptions(dataset))
      result = decl.to_table()
      assert result.schema.names == [
          "a",
          "b",
          "__fragment_index",
          "__batch_index",
          "__last_in_fragment",
          "__filename",
      ]
      assert result.select(["a", "b"]).equals(table)
  
      # using a filter only does pushdown (depending on file format), not actual filter
  
      scan_opts = ScanNodeOptions(dataset, filter=field("a") > 1)
      decl = Declaration("scan", scan_opts)
      # fragment not filtered based on min/max statistics
      assert decl.to_table().num_rows == 3
  
      scan_opts = ScanNodeOptions(dataset, filter=field("a") > 4)
      decl = Declaration("scan", scan_opts)
      # full fragment filtered based on min/max statistics
      assert decl.to_table().num_rows == 0
  
      # projection scan option
  
      scan_opts = ScanNodeOptions(
          dataset, columns={"a2": pc.multiply(field("a"), 2)}
      )
      decl = Declaration("scan", scan_opts)
      result = decl.to_table()
      # "a" is included in the result (needed later on for the actual projection)
      assert result["a"].to_pylist() == [1, 2, 3]
      # "b" is still included, but without data as it will be removed by the projection
      assert pc.all(result["b"].is_null()).as_py()
  
file_path: arrow/python/pyarrow/tests/test_acero.py
imports: import pytest
  import pyarrow
  import pyarrow.compute
  from pyarrow.compute import field
label_desc: Use image node_id 12 for calling a global function with example usage: test_scan(tempdir) without return types