class_docstr: Class to index single field in parquet dataset.
  
  This indexer only indexes numpty strings, numpty integers, or numpy arrays of strings.
class_docstr_tok: ["Class","to","index","single","field","in","parquet","dataset",".","This","indexer","only","indexes","numpty","strings",",","numpty","integers",",","or","numpy","arrays","of","strings","."]
code: def build_index(self, decoded_rows, piece_index):
      field_column = [row[self._column_name] for row in decoded_rows]
      if not field_column:
          raise ValueError(
              "Cannot build index for empty rows, column '{}'".format(
                  self._column_name
              )
          )
  
      for field_val in field_column:
          if field_val is not None:
              # check type of field, if it is array index each array value,
              # otherwise index field value directly
              if isinstance(field_val, np.ndarray):
                  for val in field_val:
                      self._index_data[val].add(piece_index)
              else:
                  self._index_data[field_val].add(piece_index)
  
      return self._index_data
  
imports: import numpy
  from collections import defaultdict
  from petastorm.etl import RowGroupIndexerBase
label_desc: Use image node_id 7 for calling the SingleFieldIndexer obj's underlying member method code with example usage: obj.build_index(decoded_rows, piece_index) and returns: self