rok commented on a change in pull request #10176:
URL: https://github.com/apache/arrow/pull/10176#discussion_r645447571



##########
File path: docs/source/cpp/compute.rst
##########
@@ -637,6 +637,55 @@ String extraction
   e.g. 'letter' and 'digit' for the regular expression
   ``(?P<letter>[ab])(?P<digit>\\d)``.
 
+Temporal component extraction
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These functions extract datetime components (year, month, day, etc) from 
timestamp type.
+Note: timezone information is currently ignored if present.
+
++--------------------+------------+-------------------+-----------------+--------+
+| Function name      | Arity      | Input types       | Output type     | 
Notes  |
++====================+============+===================+=================+========+
+| year               | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| month              | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| day                | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| day_of_week        | Unary      | Temporal          | Numeric         | \(1) 
  |
++--------------------+------------+-------------------+-----------------+--------+
+| day_of_year        | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| iso_year           | Unary      | Temporal          | Numeric         | \(2) 
  |
++--------------------+------------+-------------------+-----------------+--------+
+| iso_week           | Unary      | Temporal          | Numeric         | \(2) 
  |
++--------------------+------------+-------------------+-----------------+--------+
+| iso_calendar       | Unary      | Temporal          | Scalar Struct   | \(3) 
  |
++--------------------+------------+-------------------+-----------------+--------+
+| quarter            | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| hour               | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| minute             | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| second             | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| millisecond        | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| microsecond        | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| nanosecond         | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+| subsecond          | Unary      | Temporal          | Numeric         |      
  |
++--------------------+------------+-------------------+-----------------+--------+
+
+* \(1) Outputs the number of the day of the week. Week begins on Monday and is 
denoted
+  by 0 and ends on Sunday denoted by 6.
+* \(2) First ISO week has the majority (4 or more) of it's days in January. 
ISO year
+  starts with the first ISO week.
+  See `ISO 8601 week date definition`_ for more details.
+* \(3) Output is a ``{"iso_year": output type, "iso_week": output type, 
"day_of_week":  output type}`` Struct.
+.. _ISO 8601 week date definition: 
https://en.wikipedia.org/wiki/ISO_week_date#First_week

Review comment:
       Sounds like a good idea!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to