Github user cestella commented on the issue:

    https://github.com/apache/incubator-metron/pull/304
  
    Haha, definitely @ottobackwards comment!  Thanks for the feedback. :)
    
    * I found a potential situation with the CSVParser wrt timestamps that 
would prevent users from retaining the timestamps passed in.  If you pass in a 
timestamp and do NOT configure the CSVParser to parse the timestamp (via the 
`timestampFormat` config option), then it'll overwrite your timestamp field 
with null, which would mean you have no ability to parse the timestamp in 
stellar downstream. 
    
    Consider the following config:
    ```
     {
          "parserClassName" : "org.apache.metron.parsers.csv.CSVParser"
         ,"parserConfig": {
             "columns" : {
                    "data" : 0
                   ,"timestamp" : 1
                     }
         }
          ,"fieldTransformations" : [
              {
               "transformation" : "STELLAR"
              ,"output" : "timestamp"
              ,"config" : {
                "timestamp" : "TO_EPOCH_TIMESTAMP(timestamp, 'yyyy-MM-dd 
HH:mm:ss', 'UTC')"
                          }
              }
                                   ]
       }
    ```
    with the following data, `foo,2016-01-05 17:02:30`
    As it stands, the CSVParser would return:
    ```
    {
      "original_string" : "foo,2016-01-05 17:02:30"
      ,"data" : "foo"
      ,"timestamp" : null
    ```
    thereby dropping the timestamp field instead of passing it through if you 
choose to NOT have the parser manage the timestamps.
    
    * The benefit is that you have the choice now to do it in Stellar, but I 
would prefer to stay backwards compatible.  Since the CSVParser supported 
timestamp parsing before this PR, I left it in (and fixed a bug that would have 
made it impossible to pass timestamps through).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to