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

    https://github.com/apache/nifi/pull/1983#discussion_r126360491
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
 ---
    @@ -828,10 +833,50 @@ private void setParameter(final PreparedStatement 
stmt, final String attrName, f
                         stmt.setBigDecimal(parameterIndex, new 
BigDecimal(parameterValue));
                         break;
                     case Types.DATE:
    -                    stmt.setDate(parameterIndex, new 
Date(Long.parseLong(parameterValue)));
    +                    Date date;
    +
    +                    if (valueFormat.equals("")) {
    +                        if(LONG_PATTERN.matcher(parameterValue).matches()){
    +                            date = new 
Date(Long.parseLong(parameterValue));
    +                        }else {
    +                            String dateFormatString = "yyyy-MM-dd";
    +                            if (!valueFormat.isEmpty()) {
    --- End diff --
    
    This condition won't be true as it already checks `valueFormat.equals("")` 
above. BTW, I personally prefer `isEmpty()`  than `equals("")`. Existing code 
for TIMESTAMP uses `equals("")` though.


---
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