apache / apache/hudi

[SUPPORT] Hudi 1.0.1 compaction issue resolved , but facing new issue in hive on tez that so many duplicates are created for each row

Open
#13,302 15 comments 0 reactions 0 assignees View on GitHub
engine:hive engine:spark issue:data-consistency
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

**_Tips before filing an issue_**

- Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?

- Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.

- If you have triaged this as a bug, then file an [issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.

**Describe the problem you faced**

We are running spark job on spark server , which create hudi tables(COW) from csv files present in HDFS and sync those tables to Hive-on-Tez . But after syncing to the hive too many duplicates are created for each record and shows count was 3 times higher than the actual count . This is for new version of hudi 1.0.1 .Before we used hudi 0.14.1 but we faced hudi compaction issue in that version. Now in this verison we are facing the duplicate count issue..

After close observation of hudi 0.14.1 and hudi 1.0.1 , i came to know that in hudi 0.14.1 the log file in metadata folder will keep on increasing for each run , Where in hudi 1.0.1 separate log files are created for each job run . So i want to use the hudi 1.0.1 metadata log creation method in hudi 0.14.1 to create separate log files for each run.. If possible please provide the method like which code i need to change to work log creation method of 1.0.1 to 0.14.1

A clear and concise description of the problem.

**To Reproduce**

Steps to reproduce the behavior:

1. Add sample csv files in hdfs
2.create Hudi files using those csv files
3.sync those hudi parquet files to hive
4.Run aggregation queries on those tables in hive
Note:- Tez is the execution engine Hive

**Expected behavior**

A clear and concise description of what you expected to happen.

It needs to give the exact no of rows count which is present in hudi parqet files when we run select count(*) from table;

**Environment Description**

* Hudi version : 1.0.1

* Spark version : 3.4.4

* Hive version : 4.0.1

* Hadoop version : 3.4.1

* Storage (HDFS/S3/GCS..) : HDFS

* Running on Docker? (yes/no) : no

**Additional context**
Below is the properties i added in **hive-site.xml** , then only its working (count issue is still there)

"
hive.input.format
org.apache.hudi.hadoop.hive.HoodieCombineHiveInputFormat

hive.tez.input.format
org.apache.hadoop.hive.ql.io.HiveInputFormat

hive.fetch.task.conversion
none
Disables fetch optimization to force queries to run as MapReduce or Tez jobs.

hive.input.format
org.apache.hudi.hadoop.realtime.HoodieParquetRealtimeInputFormat
"

If i remove the above properties , hive is able to work properly but more than 1 lakh records are giving error , also aggreagtion queries not working except **select (*) ** and **select count(*) ** that too if records are below 1 lakh

Add any other context about the problem here.

**Stacktrace** for 1 lakh records issue

Caused by: org.apache.hudi.org.apache.avro.AvroRuntimeException: Duplicate field _hoodie_commit_time in record spark_schema: _hoodie_commit_time type:UNION pos:13 and _hoodie_commit_time type:UNION pos:0

```Add the stacktrace of the error.```

**Please tell me how can i use log creation method of hudi 1.0.1 in metadata for hudi 0.14.1 version**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported Hudi 1.0.1 COW-to-Hive-on-Tez reproduction using CSV files on HDFS, then compare behavior with Hudi 0.14.1. Review the hive-site.xml input-format settings and the reported duplicate _hoodie_commit_time stacktrace. Done means Hive aggregation counts match the Hudi Parquet row count without duplicate records or the Avro error.

Written by the indexing model from the issue text.

Assessment

Tech stack
hadoop, spark
Domain
data-engineering, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.