<?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: NiFI Failed to update Hive for FlowFile; java.lang.ArithmeticException: / by zero in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/412135#M253265</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97121"&gt;@linssab&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error (java.lang.ArithmeticException: / by zero in HiveSplitGenerator) usually comes from Hive when the query compiles into an empty or invalid input split. With PutHive3QL, DELETE/UPDATE operations on ACID tables often trigger a full table scan, and if stats are missing or corrupted, Tez can fail this way. First, try running the same SQL directly in Hive CLI/Beeline to confirm it’s not NiFi-specific. Then, run ANALYZE TABLE &amp;lt;table&amp;gt; COMPUTE STATISTICS and ANALYZE TABLE &amp;lt;table&amp;gt; COMPUTE STATISTICS FOR COLUMNS to refresh stats. Also check that the table is bucketed/transactional as required for ACID.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 08:54:21 GMT</pubDate>
    <dc:creator>RAGHUY</dc:creator>
    <dc:date>2025-08-19T08:54:21Z</dc:date>
    <item>
      <title>NiFI Failed to update Hive for FlowFile; java.lang.ArithmeticException: / by zero</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/408328#M252684</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am using a NiFi flow to create an SQL statement dynamically and execute it with a&amp;nbsp;&lt;STRONG&gt;PutHive3QL&lt;/STRONG&gt; processor to &lt;U&gt;delete&lt;/U&gt; records from a Hive table that supports ACID transactions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PutHive3Streaming&lt;/STRONG&gt; works correctly to write new records to the table and apparently the table is working fine and there are no credentials issues.&lt;/P&gt;&lt;P&gt;The error I am getting with&amp;nbsp;&lt;STRONG&gt;PutHive3QL&lt;/STRONG&gt;&amp;nbsp;is puzzling me and I really do not understand what is going on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;11:32:04 CESTERROR5b0a3ca0-21d2-16cf-a426-a2b4518fb710
All NodesPutHive3QL[id=5b0a3ca0-21d2-16cf-a426-a2b4518fb710] Failed to update Hive for FlowFile[filename=f77e9d70-415b-4037-9b35-5376192d6d8c] due to Error while compiling statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1747050143707_0616_1_00, diagnostics=[Vertex vertex_1747050143707_0616_1_00 [Map 1] killed/failed due to:ROOT_INPUT_INIT_FAILURE, Vertex Input: TEST_TABLE1 initializer failed, vertex=vertex_1747050143707_0616_1_00 [Map 1], java.lang.ArithmeticException: / by zero
	at org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator.initialize(HiveSplitGenerator.java:190)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.lambda$runInitializer$3(RootInputInitializerManager.java:203)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1898)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.runInitializer(RootInputInitializerManager.java:196)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.runInitializerAndProcessResult(RootInputInitializerManager.java:177)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.lambda$createAndStartInitializing$2(RootInputInitializerManager.java:171)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:75)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
]Vertex killed, vertexName=Reducer 2, vertexId=vertex_1747050143707_0616_1_01, diagnostics=[Vertex received Kill in INITED state., Vertex vertex_1747050143707_0616_1_01 [Reducer 2] killed/failed due to:OTHER_VERTEX_FAILURE]DAG did not succeed due to VERTEX_FAILURE. failedVertices:1 killedVertices:1; it is possible that retrying the operation will succeed, so routing to retry: java.sql.SQLException: Error while compiling statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1747050143707_0616_1_00, diagnostics=[Vertex vertex_1747050143707_0616_1_00 [Map 1] killed/failed due to:ROOT_INPUT_INIT_FAILURE, Vertex Input: TEST_TABLE1 initializer failed, vertex=vertex_1747050143707_0616_1_00 [Map 1], java.lang.ArithmeticException: / by zero
	at org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator.initialize(HiveSplitGenerator.java:190)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.lambda$runInitializer$3(RootInputInitializerManager.java:203)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1898)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.runInitializer(RootInputInitializerManager.java:196)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.runInitializerAndProcessResult(RootInputInitializerManager.java:177)
	at org.apache.tez.dag.app.dag.RootInputInitializerManager.lambda$createAndStartInitializing$2(RootInputInitializerManager.java:171)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:75)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
]Vertex killed, vertexName=Reducer 2, vertexId=vertex_1747050143707_0616_1_01, diagnostics=[Vertex received Kill in INITED state., Vertex vertex_1747050143707_0616_1_01 [Reducer 2] killed/failed due to:OTHER_VERTEX_FAILURE]DAG did not succeed due to VERTEX_FAILURE. failedVertices:1 killedVertices:1&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NiFi version is&amp;nbsp;1.18.0 as a project requirement, meaning there is no chance we will be updating it anytime soon.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 09:38:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/408328#M252684</guid>
      <dc:creator>linssab</dc:creator>
      <dc:date>2025-05-14T09:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: NiFI Failed to update Hive for FlowFile; java.lang.ArithmeticException: / by zero</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/412135#M253265</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97121"&gt;@linssab&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error (java.lang.ArithmeticException: / by zero in HiveSplitGenerator) usually comes from Hive when the query compiles into an empty or invalid input split. With PutHive3QL, DELETE/UPDATE operations on ACID tables often trigger a full table scan, and if stats are missing or corrupted, Tez can fail this way. First, try running the same SQL directly in Hive CLI/Beeline to confirm it’s not NiFi-specific. Then, run ANALYZE TABLE &amp;lt;table&amp;gt; COMPUTE STATISTICS and ANALYZE TABLE &amp;lt;table&amp;gt; COMPUTE STATISTICS FOR COLUMNS to refresh stats. Also check that the table is bucketed/transactional as required for ACID.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 08:54:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/412135#M253265</guid>
      <dc:creator>RAGHUY</dc:creator>
      <dc:date>2025-08-19T08:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: NiFI Failed to update Hive for FlowFile; java.lang.ArithmeticException: / by zero</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/412139#M253268</link>
      <description>&lt;P&gt;Is the source table a JdbcStorageHandler table?&lt;/P&gt;&lt;P&gt;Please provide the DDL of the source table, the query used, and any sample data if possible. This information will help us understand the problem better.&lt;/P&gt;&lt;P&gt;Also, validate the set -v command, especially configurations like &lt;STRONG&gt;hive.tez.container.size&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 09:26:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFI-Failed-to-update-Hive-for-FlowFile-java-lang/m-p/412139#M253268</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2025-08-20T09:26:03Z</dc:date>
    </item>
  </channel>
</rss>

