class_docstr: SortKey class to convert between different sort args formats.
class_docstr_tok: ["SortKey","class","to","convert","between","different","sort","args","formats","."]
docstr: Check the key function is valid on the given schema.
docstr_tok: ["Check","the","key","function","is","valid","on","the","given","schema","."]
code: def validate_schema(
      self, schema: Optional[Union[type, "pyarrow.lib.Schema"]]
  ):
      """Check the key function is valid on the given schema."""
      if schema is None:
          # Dataset is empty/cleared, validation not possible.
          return
  
      if self._columns and len(schema.names) > 0:
          for column in self._columns:
              if column not in schema.names:
                  raise ValueError(
                      "The column '{}' does not exist in the "
                      "schema '{}'.".format(column, schema)
                  )
  
imports: from typing import TYPE_CHECKING, List, Optional, Tuple, TypeVar, Union
  import numpy
  from ray.data._internal.block_list import BlockList
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data._internal.progress_bar import ProgressBar
  from ray.data._internal.push_based_shuffle import PushBasedShufflePlan
  from ray.data._internal.remote_fn import cached_remote_fn
  from ray.data._internal.shuffle import ShuffleOp, SimpleShufflePlan
  from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata
  from ray.data.context import DataContext
  from ray.types import ObjectRef
label_desc: Use image node_id 6 for calling the SortKey obj's underlying member method code with example usage: obj.validate_schema(schema) without return types