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

ASF GitHub Bot commented on METRON-1816:
----------------------------------------

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

    https://github.com/apache/metron/pull/1233#discussion_r226064136
  
    --- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/DateFunctions.java
 ---
    @@ -109,6 +110,13 @@ public static long getEpochTime(String date, String 
format, Optional<String> tim
         return sdf.parse(date).getTime();
       }
     
    +  public static String getDateFormat(String format, Optional<Long> 
epochTime, Optional<String> timezone) {
    +    Long time = epochTime.orElseGet(System::currentTimeMillis);
    +    TimezonedFormat fmt = timezone.map(s -> new TimezonedFormat(format, 
s)).orElseGet(() -> new TimezonedFormat(format));
    +    SimpleDateFormat sdf = formatCache.get(fmt).get();
    --- End diff --
    
    are there any errors we need to wrap here?


> Date format Stellar function
> ----------------------------
>
>                 Key: METRON-1816
>                 URL: https://issues.apache.org/jira/browse/METRON-1816
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Ryan Merriman
>            Priority: Major
>
> It would be useful to have a Stellar function that exposes the Java 
> SimpleDateFormat capability.  This will allow us to correctly format date 
> fields for storage platforms that require a specific date format (Solr for 
> example).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to