code: def hours(col: "ColumnOrName") -> Column:
      """
      Partition transform function: A transform for timestamps
      to partition data into hours.
  
      .. versionadded:: 4.0.0
  
      Parameters
      ----------
      col : :class:`~pyspark.sql.Column` or str
          target date or timestamp column to work on.
  
      Returns
      -------
      :class:`~pyspark.sql.Column`
          data partitioned by hours.
  
      Examples
      --------
      >>> df.writeTo("catalog.db.table").partitionedBy(   # doctest: +SKIP
      ...     partitioning.hours("ts")
      ... ).createOrReplace()
  
      Notes
      -----
      This function can be used only in combination with
      :py:meth:`~pyspark.sql.readwriter.DataFrameWriterV2.partitionedBy`
      method of the `DataFrameWriterV2`.
  
      """
      return _invoke_function_over_columns("hours", col)
  
file_path: spark/python/pyspark/sql/functions/partitioning.py
imports: import sys
  from typing import TYPE_CHECKING, Union
  from pyspark.errors import PySparkTypeError
  from pyspark.sql.column import Column, _to_java_column, _create_column_from_literal
  from pyspark.sql.functions.builtin import _invoke_function_over_columns, _invoke_function
  from pyspark.sql.utils import try_partitioning_remote_functions, get_active_spark_context
label_desc: Use image node_id 4 for calling a global function with example usage: hours(col) and returns: _invoke_function_over_columns