Hi Team,
I need to validate XML file values with hive table values.
The XML values inject into HDFS using Nifi job & created a table in Hive.
We need to validate the values. can any one help me how to do validation?
Thanks
Raghav
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amira BedhiafiPosted Mar 18, 2025, 10:08 PM
To process XML in NiFi
If the XML is already in HDFS, use CREATE EXTERNAL TABLE with
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'or convert it into ORC/Parquet.Use
EXCEPTorJOINto compare XML-loaded data with reference Hive table:or
You can use ExecuteSQL in NiFi to query both tables and check for mismatches and compare datasets using RouteOnAttribute or QueryRecord.
If the dataset is large, you can use PySpark for efficient validation: