code: def _get_rg_statistics(row_group, col_names):
      """Custom version of pyarrow's RowGroupInfo.statistics method
      (https://github.com/apache/arrow/blob/master/python/pyarrow/_dataset.pyx)
  
      We use column names to specify the specific subset of columns
      that we need statistics for.  This is more optimal than the
      upstream `RowGroupInfo.statistics` method, which will return
      statistics for all columns.
      """
  
      row_group_schema = {
          col_name: i
          for i, col_name in enumerate(row_group.schema.names)
      }
  
      def name_stats(column_name):
          col = row_group.metadata.column(row_group_schema[column_name])
  
          stats = col.statistics
          if stats is None or not stats.has_min_max:
              return None, None
  
          name = col.path_in_schema
          field_index = row_group.schema.get_field_index(name)
          if field_index < 0:
              return None, None
  
          return col.path_in_schema, {
              "min": stats.min,
              "max": stats.max,
              "null_count": stats.null_count,
          }
  
      return {
          name: stats
          for name, stats in map(name_stats, col_names)
          if stats is not None
      }
  
imports: from __future__ import annotations
  import json
  import operator
  import textwrap
  import warnings
  from collections import defaultdict
  from datetime import datetime
  from functools import reduce
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  from fsspec.core import expand_paths_if_needed, stringify_path
  from fsspec.implementations.arrow import ArrowFSWrapper
  from pyarrow import dataset
  from pyarrow import fs
  import dask
  from dask.base import tokenize
  from dask.core import flatten
  from dask.dataframe.backends import pyarrow_schema_dispatch
  from dask.dataframe.io.parquet.utils import Engine, _get_aggregation_depth, _infer_split_row_groups, _normalize_index_columns, _process_open_file_options, _row_groups_to_parts, _set_gather_statistics, _set_metadata_task_size, _sort_and_analyze_paths
  from dask.dataframe.io.utils import _get_pyarrow_dtypes, _is_local_fs, _open_input_files
  from dask.dataframe.utils import clear_known_categories, pyarrow_strings_enabled
  from dask.delayed import Delayed
  from dask.utils import getargspec, natural_sort_key
label_desc: Use image node_id 8 for calling a global function with example usage: _get_rg_statistics(row_group, col_names) and returns: unknown, col,  dict, None,  None, None,  None