[
https://issues.apache.org/jira/browse/NIFI-9547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17470186#comment-17470186
]
Joe Gresock commented on NIFI-9547:
-----------------------------------
In Kudu, run:
{code:java}
create database testing;
create table testing.mytable(id INTEGER, name STRING, birth_timestamp
TIMESTAMP, PRIMARY KEY(id)) PARTITION BY HASH(id) PARTITIONS 4 STORED AS KUDU;
INSERT INTO testing.mytable VALUES (1, "John", CAST('2001-01-09 01:05:01' AS
TIMESTAMP));
{code}
Running the attached flow with the Kudu Masters parameter filled in should
result in logging the name John instead of Harry in the substituted record.
> LookupRecord could support more data types in replacements
> ----------------------------------------------------------
>
> Key: NIFI-9547
> URL: https://issues.apache.org/jira/browse/NIFI-9547
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Reporter: Joe Gresock
> Priority: Major
> Attachments: NIFI-9547.json
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> LookupRecord can currently only replace values with numeric, boolean, or
> string data types. If a timestamp field, for example, is configured as a
> dynamic property, LookupRecord will pass a string value to the LookupService.
> In implementations like KuduLookupService, this can cause an exception such
> as the following, if the field is actually a timestamp column in Kudu:
> {code:java}
> Caused by: java.lang.IllegalArgumentException: deactivationdate's type isn't
> [Type: string, Type: varchar], it's unixtime_micros
> at
> org.apache.kudu.client.KuduPredicate.checkColumn(KuduPredicate.java:1171)
> at
> org.apache.kudu.client.KuduPredicate.newComparisonPredicate(KuduPredicate.java:434)
> at
> org.apache.kudu.client.KuduPredicate.newComparisonPredicate(KuduPredicate.java:547)
> at
> org.apache.nifi.controller.kudu.KuduLookupService.lambda$lookup$1(KuduLookupService.java:260)
> {code}
> We should add support for more data types using something like
> DataTypeUtils.convertType.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)