Reputation: 825
I use the ConvertJSONToSql to convert each Json flowfile to sql, however I keep on getting this error
Could not find IS_AUTOINCREMENT in [table_cat, table_schem, table_name, column_name, data_type, type_name, column_size, buffer_length, decimal_digits, num_prec_radix, nullable, remarks, column_def, sql_data_type, sql_datetime_sub, char_octet_length, ordinal_position, is_nullable, scope_catalog, scope_schema, scope_table, source_data_type, is_auto_increment]
I don't know the reason for this. I just created my table in hive like the following:
create table ...
...
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
Upvotes: 0
Views: 332
Reputation: 11
This relates to Hive-13528. The JIRA description is copied below for completeness.
As stated by the documentation, the return of getColumns() from DatabaseMetaData (https://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)) should return a ResultSet with a few columns, including one named "IS_AUTOINCREMENT" used to describe if the attribute is auto increment. However, in Hive implementation, the column is named "IS_AUTO_INCREMENT" (as stated in line 107 of file service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java).
Your options at this point are to wait for the Hive fix to roll out and apply it, or you could build your own nifi-standard-nar bundle with a modified ConvertJSONToSQL processor. The 'IS_AUTOINCREMENT' name is hardcoded in that processor.
Upvotes: 1