Member since
04-06-2022
15
Posts
2
Kudos Received
2
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
676 | 05-14-2025 01:39 AM | |
3563 | 01-12-2023 06:48 AM |
05-14-2025
02:38 AM
Hi there, I am using a NiFi flow to create an SQL statement dynamically and execute it with a PutHive3QL processor to delete records from a Hive table that supports ACID transactions. PutHive3Streaming works correctly to write new records to the table and apparently the table is working fine and there are no credentials issues. The error I am getting with PutHive3QL is puzzling me and I really do not understand what is going on. Any help is appreciated! 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 NiFi version is 1.18.0 as a project requirement, meaning there is no chance we will be updating it anytime soon.
... View more
Labels:
- Labels:
-
Apache Hive
-
Apache NiFi
05-14-2025
01:39 AM
1 Kudo
You can use a Groovy script with the ExecuteGroovyScript processor. See this answer here for details
... View more
04-12-2023
05:45 AM
Ok, now that makes sense. I downloaded from the official repository Index of /dist/nifi (apache.org) and I'm using version 1.13.2 (due to some project requirements)
... View more
04-12-2023
03:43 AM
Caused by: java.lang.Exception: The specified login identity provider class 'org.apache.nifi.authentication.single.user.SingleUserLoginIdentityProvider' is not known to this nifi. I am trying to set up a nifi instance in a Ubuntu Server 22.04 machine. It's been hours I've been tinkering with the configurations and xml files and still I'm getting the error above. These are the configurations I am passing in the nifi.properties, authorizers.xml, login-identity-providers.xml and authorizations.xml files are in the screenshot below. I have tried specifying a user and password in the identity providers file but still nothing...
... View more
Labels:
- Labels:
-
Apache NiFi
01-13-2023
03:26 AM
Ok, I understand now what you are doing. The problem is that you are trying to merge information from one FlowFile to another, and this can't be done in the way you designed. Two FlowFiles mean two separate processes, they don't communicate with one another. You have to use one single FlowFile for the entire process if you need information from both the JSON and XML. I suggest putting the EvaluateXPath after the UpdateAttributes processor, setting the Destination property to "flowfile-attribute" in a way you will have all the attributes in the same flowfile (titlefromXML, guid, Contact Name, caseno, and docno) to use in the JOLT specification. -- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.
... View more
01-13-2023
01:27 AM
Hey Willy, I'm glad I was able to help. As for the properties, I'm assuming you meant attributes. The JoltTransformJSON supports Expression Language (EL) with Variable Registry and FlowFile attributes. This means you can access any attribute in your flowfile with EL syntax, as ${attributeName} If your flowfile (that reads the XML file) Content is a JSON, you can extract values from the JSON and turn them into attributes with the EvaluateJsonPath processor as below: Then you can use these attributes in the JoltTransform with the syntax written above. However, if the flowfile content is not a JSON and EvaluateJsonPath does not serve the purpose, you can try extracting the information within the FlowFile and turn them into attributes using the ExtractText processor. Let's say teh XLM FLowFile content is: <property1="FieldValue1">
<caseno="foobar">
<property2="FieldValue2"> You can use the syntax below to extract the caseno field and set it as an attribute in the FlowFile caseno=\s*"(\w+)" -- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.
... View more
01-12-2023
06:48 AM
You have a few options here. Replace text could do the trick with some regex expression but it can get quite complex. I would suggest you use the JoltTransformJSON processor. The follow JOLT Specification will work for you considering your flowfile have the title, id, and contact-name attributes. Replace accordingly. [
{
"operation": "modify-overwrite-beta",
"spec": {
"parameter": {
"Title": "${title}",
"ExternalId": { "Id": "${id}" }
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"UnregisteredContacts": { "[1]": { "ContactName": "${contact-name}" } }
}
}
}
]
... View more
01-12-2023
03:44 AM
Idk if it is much of a help, but you can try checking the Jolt Transform quick reference There's this link to test JOLT specifications. You can try starting with something like [{
"operation": "shift",
"spec": {
"*": "&"
}
}, {
"operation": "default",
"spec": {
"*": {
"id": "&(1,0)"
}
}
}]
... View more
01-12-2023
02:15 AM
You can try modifying the Record Reader avro schema to something like this: {"name": "xxx", "type": "string"], "default": ""}
... View more
01-12-2023
01:09 AM
Hello, This may be a silly question but I'm in a bit of a loss and have been stuck for a couple days now trying to find a solution. I have a flow design where I have to validate a record against an avro schema and insert that record in a Kudu table. The avro validation schema is: {
"type" : "record",
"name" : "tbcertificati",
"fields" : [
{ "name" : "num_caso", "type" : "string" },
{ "name" : "num_rch", "type" : "string" },
{ "name" : "num_cert", "type" : "string" },
{ "name" : "seqno", "type" : "string" },
{ "name" : "data_inizio_kudu", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "num_vis", "type" : "double" },
{ "name" : "data_compilaz_cert", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "data_acquisiz_cert", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "cod_matr_med", "type" : "double" },
{ "name" : "medico_struttura", "type" : "string" },
{ "name" : "flag_int_ext", "type" : "string" },
{ "name" : "cod_cert", "type" : "string" },
{ "name" : "cod_prognosi", "type" : "double" },
{ "name" : "data_iniz_prognosi", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "data_fine_prognosi", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "desc_cert", "type" : "string" },
{ "name" : "data_ripresa_lav", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "flag_postumi", "type" : "string" },
{ "name" : "flag_medico_stru", "type" : "string" },
{ "name" : "note", "type" : "string" },
{ "name" : "prg", "type" : "double" },
{ "name" : "crt_time", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "id_usr_crt", "type" : "string" },
{ "name" : "mod_time", "type" : {
"type":"long",
"logicalType":"timestamp-millis"}},
{ "name" : "id_usr_mod", "type" : "string" },
{ "name" : "fl_annullato", "type" : "string" },
{ "name" : "dm_timestamp", "type" : "string" },
{ "name" : "dm_txid", "type" : "string" },
{ "name" : "dm_operation_type", "type" : "string" }
]
} A record can arrive like this: {
"DM_TIMESTAMP" : "1970-01-01 00:00:00.000",
"DM_TXID" : "1",
"DM_OPERATION_TYPE" : "A",
"DM_USER" : "STRING",
"NUM_CASO" : "1",
"NUM_RCH" : "1",
"NUM_CERT" : "1",
"NUM_VIS" : "",
"DATA_COMPILAZ_CERT" : "1970-01-01 00:00:00",
"DATA_ACQUISIZ_CERT" : "",
"COD_MATR_MED" : "",
"MEDICO_STRUTTURA" : "",
"FLAG_INT_EXT" : "A",
"COD_CERT" : "A",
"COD_PROGNOSI" : "1",
"DATA_INIZ_PROGNOSI" : "",
"DATA_FINE_PROGNOSI" : "",
"DESC_CERT" : "",
"DATA_RIPRESA_LAV" : "1970-01-01",
"FLAG_POSTUMI" : "",
"FLAG_MEDICO_STRU" : "A",
"NOTE" : "",
"PRG" : "1",
"CRT_TIME" : "1970-01-01 00:00:00",
"ID_USR_CRT" : "STRING",
"MOD_TIME" : "1970-01-01 00:00:00",
"ID_USR_MOD" : "STRING",
"FL_ANNULLATO" : "A",
"SEQNO" : "1",
"DATA_INIZIO_KUDU" : 1673274352029
} The putKudu processor is as following: Validation record always fails, and if trying to directly insert the record with the PutKudu processor, I get the error: Failed to write due to Can't set primary key column foo to null : java.land.IllegalArgumentException: Can't set primary key column num_caso to null I have trying capitalizing/decapitalizing the field names, with no success. The field clearly has a value associated to it, I don't understand why it is said to be null. Thanks in advance.
... View more
Labels:
- Labels:
-
Apache Kudu
-
Apache NiFi