<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161163#M45095</link>
    <description>&lt;P&gt;QueryDatabaseTable does indeed treat DECIMAL and NUMERIC types as strings in the outgoing Avro, there is a Jira (&lt;A target="_blank" href="https://issues.apache.org/jira/browse/NIFI-2624"&gt;NIFI-2624&lt;/A&gt;) to improve the handling of these types. In the meantime, you might be able to use &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.kite.ConvertAvroSchema/index.html"&gt;ConvertAvroSchema&lt;/A&gt;, but you won't be able to support BigDecimal values there either; it only supports conversion to/from int, long, double, and float. If your values fit in a double, that might work for now.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2016 23:39:09 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2016-11-02T23:39:09Z</dc:date>
    <item>
      <title>QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161160#M45092</link>
      <description>&lt;P&gt;I am trying to import data from a postgresql table to Hive using Apache Nifi using a simple flow QueryDatabaseTable -&amp;gt; PutHiveStreamig and getting following error.&lt;/P&gt;&lt;PRE&gt;WARN [put-hive-streaming-0] org.apache.hive.hcatalog.data.JsonSerDe Error [org.codehaus.jackson.JsonParseException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors&lt;/PRE&gt;&lt;P&gt;Source table is having some columns of type Numeric which I think is not handled well in the Nifi code causing error while interpreting data types at Hive side. In JSON record, numeric values are appearing as strings with quotes like "33.750".  Is there a work around for the problem ?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 18:56:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161160#M45092</guid>
      <dc:creator>vmaroli</dc:creator>
      <dc:date>2016-11-02T18:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161161#M45093</link>
      <description>&lt;P&gt;In &lt;A href="https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JdbcCommon.java"&gt;JdbcCommon.java&lt;/A&gt;, see lines 318 - 322&lt;/P&gt;&lt;PRE&gt;// Did not find direct suitable type, need to be clarified!!!!
case DECIMAL:
case NUMERIC: builder.name(columnName).type().unionOf().nullBuilder().endNull().and().stringType().endUnion().noDefault();
              break;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 19:04:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161161#M45093</guid>
      <dc:creator>vmaroli</dc:creator>
      <dc:date>2016-11-02T19:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161162#M45094</link>
      <description>&lt;P&gt;can you post the DDL of both tables?&lt;/P&gt;&lt;P&gt;Check out my example:   &lt;A href="https://community.hortonworks.com/articles/64122/incrementally-streaming-rdbms-data-to-your-hadoop.html"&gt;https://community.hortonworks.com/articles/64122/incrementally-streaming-rdbms-data-to-your-hadoop.html&lt;/A&gt;   &lt;/P&gt;&lt;P&gt;Are there a lot of nulls?&lt;/P&gt;&lt;P&gt;Can you post an example row?&lt;/P&gt;&lt;P&gt;What JDK and NIFI versions are you using?&lt;/P&gt;&lt;P&gt;What version of Hive and Hadoop are you running?&lt;/P&gt;&lt;P&gt;It may be an issue like this when some data is a number and some is an number in quotes&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/PIG-3407"&gt;https://issues.apache.org/jira/browse/PIG-3407&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Maybe this fix is relevant &lt;A href="https://community.hortonworks.com/questions/17996/nifi-applying-an-avro-schema-in-convertcsvtoavro.html"&gt;https://community.hortonworks.com/questions/17996/nifi-applying-an-avro-schema-in-convertcsvtoavro.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do you have the latest HDF 2.01 version?&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.hortonworks.com/HDPDocuments/HDF2/HDF-2.0.1/index.html" target="_blank"&gt;http://docs.hortonworks.com/HDPDocuments/HDF2/HDF-2.0.1/index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 20:48:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161162#M45094</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2016-11-02T20:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161163#M45095</link>
      <description>&lt;P&gt;QueryDatabaseTable does indeed treat DECIMAL and NUMERIC types as strings in the outgoing Avro, there is a Jira (&lt;A target="_blank" href="https://issues.apache.org/jira/browse/NIFI-2624"&gt;NIFI-2624&lt;/A&gt;) to improve the handling of these types. In the meantime, you might be able to use &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.kite.ConvertAvroSchema/index.html"&gt;ConvertAvroSchema&lt;/A&gt;, but you won't be able to support BigDecimal values there either; it only supports conversion to/from int, long, double, and float. If your values fit in a double, that might work for now.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 23:39:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161163#M45095</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-11-02T23:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161164#M45096</link>
      <description>&lt;P&gt;Thanks for the response. Tried with ConvertAvroSchema and is working fine.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:04:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161164#M45096</guid>
      <dc:creator>vmaroli</dc:creator>
      <dc:date>2016-11-03T16:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable - importing from postgresql table with Numeric and decimal data type columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161165#M45097</link>
      <description>&lt;P&gt;I am using HDF-2.0.1.0-12 with HDP 2.4 (Hive 1.2.1.2.4. HDFS 2.7.1.2.4) . jdk1.8.0_71&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:07:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/QueryDatabaseTable-importing-from-postgresql-table-with/m-p/161165#M45097</guid>
      <dc:creator>vmaroli</dc:creator>
      <dc:date>2016-11-03T16:07:48Z</dc:date>
    </item>
  </channel>
</rss>

