Object
org.apache.spark.sql.internal.connector.ExpressionWithToString
org.apache.spark.sql.connector.expressions.Extract
All Implemented Interfaces:
Serializable, Expression

@Evolving public class Extract extends org.apache.spark.sql.internal.connector.ExpressionWithToString
Represent an extract function, which extracts and returns the value of a specified datetime field from a datetime or interval value expression.

The currently supported fields names following the ISO standard:

  1. SECOND Since 3.4.0
  2. MINUTE Since 3.4.0
  3. HOUR Since 3.4.0
  4. MONTH Since 3.4.0
  5. QUARTER Since 3.4.0
  6. YEAR Since 3.4.0
  7. DAY_OF_WEEK Since 3.4.0
  8. DAY Since 3.4.0
  9. DAY_OF_YEAR Since 3.4.0
  10. WEEK Since 3.4.0
  11. YEAR_OF_WEEK Since 3.4.0
Since:
3.4.0
See Also:
  • Constructor Details

  • Method Details

    • field

      public String field()
    • source

      public Expression source()
    • children

      public Expression[] children()
      Description copied from interface: Expression
      Returns an array of the children of this node. Children should not change.