You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2022/02/19 20:32:39 UTC

[GitHub] [drill] agozhiy opened a new pull request #2469: DRILL-8143: Error querying json with $date field

agozhiy opened a new pull request #2469:
URL: https://github.com/apache/drill/pull/2469


   # [DRILL-8143](https://issues.apache.org/jira/browse/DRILL-8143): Error querying json with $date field
   
   ## Description
   
   Drill cannot parse TZ offset in 'date' type in MongoDB extended json. The solution is to use ISO_OFFSET_DATE_TIME formatter that can handle both zero and non-zero offsets. 
   Note that it will support offsets in the following dormats:
   'Z', 'HH', 'HH:mm', but not 'HHmm' (Which is also corresponds with ISO 8601, but is not supported by any predefined formatter)
   
   ## Documentation
   
   ## Testing
   Modified unit tests and tested manally.
   


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] agozhiy commented on pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
agozhiy commented on pull request #2469:
URL: https://github.com/apache/drill/pull/2469#issuecomment-1046897920


   @jnturton, I hope I fixed the endings, please take a look.


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] jnturton commented on pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
jnturton commented on pull request #2469:
URL: https://github.com/apache/drill/pull/2469#issuecomment-1046775139


   @agozhiy, an afterthought about sqlline.bat: please ensure that your editor does not save this file with UNIX line endings.  They should remain CRLF.  Git can also do some creative things here if you have nonstandard settings.
   
   ```
   ➜  drill git:(master) ✗ file distribution/src/main/resources/sqlline.bat
   distribution/src/main/resources/sqlline.bat: DOS batch file, ASCII text, with CRLF line terminators
   ```


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] jnturton merged pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
jnturton merged pull request #2469:
URL: https://github.com/apache/drill/pull/2469


   


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] agozhiy commented on pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
agozhiy commented on pull request #2469:
URL: https://github.com/apache/drill/pull/2469#issuecomment-1046728785


   @luocooong, it appears that in Java 8 only +-HH:mm offset format is supported (while in Java 11 minutes are optional).
   I suppose I need to add a custom formatter then, as there is no perfect solution in predefined ones.
   


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] luocooong commented on pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
luocooong commented on pull request #2469:
URL: https://github.com/apache/drill/pull/2469#issuecomment-1046642315


   @agozhiy Thanks for the contribution. As the CI result, we can get an interesting consensus : looks like only JDK 11 + support both the local time format `TZ` and time zone format `+offset` using the `DateTimeFormatter.ISO_OFFSET_DATE_TIME`.
   So, could you please add the implementation of JDK11 for JDK8 build?


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] jnturton commented on pull request #2469: DRILL-8143: Error querying json with $date field

Posted by GitBox <gi...@apache.org>.
jnturton commented on pull request #2469:
URL: https://github.com/apache/drill/pull/2469#issuecomment-1046664690


   @agozhiy an alternative to @luocooong's importing java.time classes from JDK 11 is to write a fallback along the lines of
   
   ```
   try {
     ISO_OFFSET_DATE_TIME.parse(...);
   } catch (DateTimeParseException ex) {
     // fall back to the parsing code that was present in VectorOutput before commit dc8cbb55
     // or to one of the parser patterns suggested for JDK 8 [1][2].  Please include a comment
     // explaining that the fallback is for JDK 8 if you use this approach.
   }  
     
   [1] https://stackoverflow.com/questions/46487403/java-8-date-and-time-parse-iso-8601-string-without-colon-in-offset
   [2] https://stackoverflow.com/questions/43360852/cannot-parse-string-in-iso-8601-format-lacking-colon-in-offset-to-java-8-date


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org