MaxGekk opened a new pull request #25220: [SPARK-28459][SQL] Add 
`make_timestamp` function
URL: https://github.com/apache/spark/pull/25220
 
 
   ## What changes were proposed in this pull request?
   
   New function `make_timestamp()` takes 6 columns `year`, `month`, `day`, 
`hour`, `min` and `sec`, and makes new column of the `TIMESTAMP` type. If 
values in the input columns are `null` or out of valid ranges, the function 
returns `null`. Valid ranges are:
   - `year` - `[1, 9999]`
   - `month` - `[1, 12]`
   - `day` - `[1, 31]`
   - `hour` - `[0, 23]`
   - `min` - `[0, 59]`
   - `sec` - `[0, 59.999999]`
   
   Also constructed date must be valid otherwise `make_timestamp` returns 
`null`.
   
   Here is an example:
   ```sql
   select make_timestamp(2014, 12, 28, 6, 30, 45.887);
     2014-12-28 06:30:45.887
   ```
   
   ## How was this patch tested?
   
   Added new tests to `DateExpressionsSuite`, and uncommented a test for 
`make_timestamp` in `pgSQL/timestamp.sql`.
   

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to