luocooong commented on pull request #2299:
URL: https://github.com/apache/drill/pull/2299#issuecomment-912984109
@paul-rogers Thanks for the support, there is a new check result.
Use the AGE() function in the web console :
1. Setting the current date time to `2021-09-04 10:10:00`, the timezone is
GMT+8.
2. Run and check the result :
```sql
SELECT AGE(CURRENT_TIMESTAMP, CAST('2021-09-04 10:10:00' AS TIMESTAMP)) FROM
(VALUES(1))
```
```sql
EXPR$0
PT31.859S
```
3. As the above, I think the CAST function read the value as UTC directly.
Add the AGE() in the `testDateJsonInput()` :
1. Update the code (the json value is '2019-09-30T20:47:43.123Z') :
```java
@Test
public void testDateJsonInput() throws Exception {
test("select `date`, AGE(`date`, CAST('2019-09-30 20:47:43' as timestamp))
from cp.`jsoninput/input2.json` limit 1 ");
}
```
2. Run the test and check the result :
```
date<TIMESTAMP(OPTIONAL)> EXPR$1<INTERVAL(OPTIONAL)>
2019-09-30T20:47:43.123 PT0.123S
```
Actually, In the `writeTimestamp(boolean isNull)` function, the revision
code will get the date time value with the UTC formatter, at the final, will
convert to local time (not the UTC) and store the epoch value to vector.
Did I miss anything?
--
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]