Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/428#discussion_r207624001
  
    --- Diff: 
solr/core/src/java/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.java
 ---
    @@ -172,4 +179,21 @@ public void init(NamedList args) {
           return (null == type) || type instanceof DateValueFieldType;
         };
       }
    +
    +  private static Instant parseInstant(DateTimeFormatter formatter, String 
dateStr) {
    +    final TemporalAccessor temporalAccessor = formatter.parse(dateStr);
    +    // parsed successfully.  But is it a full instant or just to the day?
    +    if(temporalAccessor.isSupported(ChronoField.OFFSET_SECONDS)) {
    --- End diff --
    
    Firstly, I think INSTANT_SECONDS should be very first check (presumed fast 
path).  
    
    Secondly, I'm doubtful that OFFSET_SECONDS is the correct thing to check 
on.  I guess I'd have to use a debugger to have any confidence.  Hmm; looking 
at `java.time.OffsetDateTime#from` is interesting.  maybe grab 
`temporal.query(TemporalQueries.localDate()` (and insist we find it otherwise 
pattern is impossibly vague?), and then attempt to get the time optionally 
(otherwise assume start of day) and the timezone optionally (default to 
configured/default zone).  Maybe that is right.


---

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

Reply via email to