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

Matt Burgess commented on NIFI-2422:
------------------------------------

According to the following, if a floating-point literal is inserted into a Hive 
Table, it is evaluated as a double:

This means when getObject() is called on the JDBC driver, it returns a Double 
not a Float. However if you get its JDBC type, it returns 6 (FLOAT). This seems 
like a Hive bug, but I couldn't find a Jira. For SelectHiveQL, we can change 
the logic from looking for Number objects in the result set and putting them 
directly into the Avro record, to checking the JDBC type and explicitly calling 
the getXYZ method for that type (getFloat() instead of getObject() if JDBC type 
is 6, e.g.)

> SelectHiveQL processor failed to process a 'select' query
> ---------------------------------------------------------
>
>                 Key: NIFI-2422
>                 URL: https://issues.apache.org/jira/browse/NIFI-2422
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Matt Burgess
>            Assignee: Matt Burgess
>             Fix For: 1.0.0
>
>
> The following query configured in SelectHiveQL processor will generate ERRORs 
> shown in the attached screenshot:
> SELECT * FROM hiveql_test_table WHERE nifinode="node1"
> However, I can run the above query successfully if I connect to the hive 
> server directly.
> The hive table schema is as follows:
> 0: jdbc:hive2://localhost:10000/hiveql_test_d> desc hiveql_test_table;
> +-----------+---------------+----------+--+
> | col_name  |   data_type   | comment  |
> +-----------+---------------+----------+--+
> | id        | int           |          |
> | nifinode  | string        |          |
> | tvarchar  | varchar(100)  |          |
> | tchar     | char(50)      |          |
> | tboolean  | boolean       |          |
> | tint      | int           |          |
> | tfloat    | float         |          |
> | tdouble   | double        |          |
> | tdate     | date          |          |
> +-----------+---------------+----------+--+
> 9 rows selected (0.416 seconds)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to