Omega359 commented on code in PR #12948: URL: https://github.com/apache/datafusion/pull/12948#discussion_r1808832107
########## docs/source/user-guide/sql/scalar_functions.md: ########## @@ -2078,52 +669,6 @@ Transforms an array into rows. +-----------------------------------+ ``` -### `range` - -Returns an Arrow array between start and stop with step. `SELECT range(2, 10, 3) -> [2, 5, 8]` or `SELECT range(DATE '1992-09-01', DATE '1993-03-01', INTERVAL '1' MONTH);` - -The range start..end contains all values with start <= x < end. It is empty if start >= end. - -Step can not be 0 (then the range will be nonsense.). - -Note that when the required range is a number, it accepts (stop), (start, stop), and (start, stop, step) as parameters, but when the required range is a date or timestamp, it must be 3 non-NULL parameters. -For example, - -``` -SELECT range(3); -SELECT range(1,5); -SELECT range(1,5,1); -``` - -are allowed in number ranges - -but in date and timestamp ranges, only - -``` -SELECT range(DATE '1992-09-01', DATE '1993-03-01', INTERVAL '1' MONTH); -SELECT range(TIMESTAMP '1992-09-01', TIMESTAMP '1993-03-01', INTERVAL '1' MONTH); -``` - -is allowed, and - -``` -SELECT range(DATE '1992-09-01', DATE '1993-03-01', NULL); -SELECT range(NULL, DATE '1993-03-01', INTERVAL '1' MONTH); -SELECT range(DATE '1992-09-01', NULL, INTERVAL '1' MONTH); -``` - -are not allowed - -#### Arguments - -- **start**: start of the range. Ints, timestamps, dates or string types that can be coerced to Date32 are supported. -- **end**: end of the range (not included). Type must be the same as start. -- **step**: increase by step (can not be 0). Steps less than a day are supported only for timestamp ranges. - -#### Aliases - -- generate_series - ## Struct Functions - [unnest](#unnest-struct) Review Comment: Filed as https://github.com/apache/datafusion/issues/13036 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
