code: def _GetEmptyRecordBatch(num_rows: int) -> pa.RecordBatch:
      assert num_rows > 0
      # pyarrow doesn't provide an API to create a record batch with zero column but
      # non zero rows. We work around it by adding a dummy column first and then
      # removing it.
      t = pa.Table.from_arrays(
          [pa.array([None] * num_rows, type=pa.null())], ["dummy"]
      )
      batches = t.remove_column(0).to_batches()
      assert len(batches) == 1
      return batches[0]
  
file_path: data-validation/tensorflow_data_validation/arrow/decoded_examples_to_arrow.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List
  import pyarrow
  import six
  from tensorflow_data_validation import types
  from tensorflow_data_validation.arrow import arrow_util
  from tfx_bsl.arrow import array_util
label_desc: Use image node_id 2 for calling a global function with example usage: _GetEmptyRecordBatch(num_rows) and returns: batches