Skip to content

Commit

Permalink
docs: update user guide to include examples for date_part and extract…
Browse files Browse the repository at this point in the history
… functions
  • Loading branch information
kosiew committed Nov 26, 2024
1 parent dec07e7 commit 5cc0442
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/user-guide/common-operations/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ Convert to timestamps using :py:func:`~datafusion.functions.to_timestamp`
df.select(f.to_timestamp(col('"Total"')).alias("timestamp"))
Extracting parts of a date using :py:func:`~datafusion.functions.date_part` (alias :py:func:`~datafusion.functions.extract`)

.. ipython:: python
df.select(
f.date_part(literal("month"), col('"event_time"')).alias("month"),
f.extract(literal("day"), col('"event_time"')).alias("day")
)
String
------

Expand Down

0 comments on commit 5cc0442

Please sign in to comment.