[
https://issues.apache.org/jira/browse/NIFI-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15964936#comment-15964936
]
ASF GitHub Bot commented on NIFI-2323:
--------------------------------------
Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1664#discussion_r111008309
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractDatabaseFetchProcessor.java
---
@@ -413,7 +400,7 @@ protected static String getLiteralByType(int type,
String value, String database
case TIMESTAMP:
// Timestamp literals in Oracle need to be cast with
TO_DATE
if ("Oracle".equals(databaseType)) {
- return "to_date('" + value + "', 'yyyy-mm-dd
HH24:MI:SS')";
+ return "timestamp '" + value + "'";
--- End diff --
This probably breaks backwards compatibility if the processor has already
stored a Date (no time-of-day) into the StateMap. To preserve backwards
compatibility, we should check if the value is just a Date and use the "date"
coercion instead of the "timestamp" coercion. If that succeeds, then the next
maximum value observed should be stored as a full timestamp and the "date"
coercion should no longer be executed
> Improve handling of Oracle datetime columns in QueryDatabaseTable and
> GenerateTableFetch
> ----------------------------------------------------------------------------------------
>
> Key: NIFI-2323
> URL: https://issues.apache.org/jira/browse/NIFI-2323
> Project: Apache NiFi
> Issue Type: Improvement
> Affects Versions: 0.6.0
> Reporter: Matt Burgess
> Assignee: Matt Burgess
>
> Due to default handling of Oracle columns returned as java.sql.Date types,
> the string literals used to compare against the column values must be in the
> same format as the NLS_DATE_FORMAT setting of the database (often YYYY-MM-DD).
> I believe when "Oracle" is provided as the database type (formerly known as
> pre-processing strategy), Oracle's Datetime Functions (such as TO_DATE or
> TO_TIMESTAMP) could be leveraged to give more fine-grained maximum-value
> information.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)