[ 
https://issues.apache.org/jira/browse/DRILL-8143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17495428#comment-17495428
 ] 

ASF GitHub Bot commented on DRILL-8143:
---------------------------------------

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: [email protected]

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


> Error querying json with $date field
> ------------------------------------
>
>                 Key: DRILL-8143
>                 URL: https://issues.apache.org/jira/browse/DRILL-8143
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.20.0
>            Reporter: Anton Gozhiy
>            Assignee: Anton Gozhiy
>            Priority: Major
>         Attachments: extended.json
>
>
> *Test Data:*
>  [^extended.json]  attached.
> *Query:*
> {code:sql}
>  select * from dfs.drillTestDir.`complex/drill-2879/extended.json` where name 
> = 'd'
> {code}
> *Expected Results:*
> Query successful, no exception should be thrown.
> *Actual Result:*
> Exception happened:
> {noformat}
> UserRemoteException :         INTERNAL_ERROR ERROR: Text 
> '2015-03-12T21:54:31.809+0530' could not be parsed at index 23
>     
> org.apache.drill.common.exceptions.UserRemoteException: INTERNAL_ERROR ERROR: 
> Text '2015-03-12T21:54:31.809+0530' could not be parsed at index 23
> Fragment: 0:0
> Please, refer to logs for more information.
> [Error Id: c984adbf-a455-4e0e-b3cd-b5aa7d83a765 on userf87d-pc:31010]
>   (java.time.format.DateTimeParseException) Text 
> '2015-03-12T21:54:31.809+0530' could not be parsed at index 23
>     java.time.format.DateTimeFormatter.parseResolved0():2046
>     java.time.format.DateTimeFormatter.parse():1948
>     java.time.Instant.parse():395
>     
> org.apache.drill.exec.vector.complex.fn.VectorOutput$MapVectorOutput.writeTimestamp():364
>     org.apache.drill.exec.vector.complex.fn.VectorOutput.innerRun():115
>     
> org.apache.drill.exec.vector.complex.fn.VectorOutput$MapVectorOutput.run():308
>     
> org.apache.drill.exec.vector.complex.fn.JsonReader.writeMapDataIfTyped():386
>     org.apache.drill.exec.vector.complex.fn.JsonReader.writeData():262
>     org.apache.drill.exec.vector.complex.fn.JsonReader.writeDataSwitch():192
>     org.apache.drill.exec.vector.complex.fn.JsonReader.writeDocument():178
>     
> org.apache.drill.exec.store.easy.json.reader.BaseJsonReader.writeToVector():99
>     org.apache.drill.exec.store.easy.json.reader.BaseJsonReader.write():70
>     org.apache.drill.exec.store.easy.json.JSONRecordReader.next():234
>     org.apache.drill.exec.physical.impl.ScanBatch.internalNext():234
>     org.apache.drill.exec.physical.impl.ScanBatch.next():298
>     org.apache.drill.exec.record.AbstractRecordBatch.next():119
>     org.apache.drill.exec.record.AbstractRecordBatch.next():111
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():59
>     
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():85
>     org.apache.drill.exec.record.AbstractRecordBatch.next():170
>     org.apache.drill.exec.record.AbstractRecordBatch.next():119
>     org.apache.drill.exec.record.AbstractRecordBatch.next():111
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():59
>     org.apache.drill.exec.record.AbstractRecordBatch.next():170
>     org.apache.drill.exec.record.AbstractRecordBatch.next():119
>     org.apache.drill.exec.record.AbstractRecordBatch.next():111
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():59
>     org.apache.drill.exec.record.AbstractRecordBatch.next():170
>     org.apache.drill.exec.record.AbstractRecordBatch.next():119
>     org.apache.drill.exec.record.AbstractRecordBatch.next():111
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():59
>     
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():85
>     org.apache.drill.exec.record.AbstractRecordBatch.next():170
>     org.apache.drill.exec.record.AbstractRecordBatch.next():119
>     org.apache.drill.exec.record.AbstractRecordBatch.next():111
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():59
>     
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():85
>     org.apache.drill.exec.record.AbstractRecordBatch.next():170
>     org.apache.drill.exec.physical.impl.BaseRootExec.next():103
>     
> org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():81
>     org.apache.drill.exec.physical.impl.BaseRootExec.next():93
>     org.apache.drill.exec.work.fragment.FragmentExecutor.lambda$run$0():321
>     java.security.AccessController.doPrivileged():-2
>     javax.security.auth.Subject.doAs():423
>     org.apache.hadoop.security.UserGroupInformation.doAs():1762
>     org.apache.drill.exec.work.fragment.FragmentExecutor.run():310
>     org.apache.drill.common.SelfCleaningRunnable.run():38
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1128
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():628
>     java.lang.Thread.run():834
> {noformat}
> *Note:* It is not reproducible in Drill 1.19.0



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to