apache / apache/hudi

[SUPPORT] The parquet files for the MOR table have been generated, but the RO table in Hive still cannot query the latest data in the parquet files.

Open
#10,907 8 comments 0 reactions 0 assignees View on GitHub
engine:flink engine:hive issue:data-consistency priority:critical
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**

Writing to hudi mor table in Flink and syncing to Hive, there is a significant data latency (6+ hours) when querying the ro table in Hive. The HDFS directory shows that .parquet files have been generated for the past few minutes, but the ro table in Hive still does not show the data from the past few minutes. Only the data from the past 6+ hours is visible.

**To Reproduce**
Steps to reproduce the behavior:

//hive sync conf
options.put(FlinkOptions.HIVE_SYNC_ENABLED.key(), "true");
options.put(FlinkOptions.HIVE_SYNC_MODE.key(), "hms");
options.put(FlinkOptions.HIVE_SYNC_DB.key(), "ods_rbs");
options.put(FlinkOptions.HIVE_SYNC_TABLE.key(), "ods_rbs_rbscmfprd_cmf_fin_acct_distributions_cdc");
options.put(FlinkOptions.HIVE_SYNC_CONF_DIR.key(), "/etc/hive/conf");
options.put(FlinkOptions.HIVE_SYNC_METASTORE_URIS.key(), connectInfo.get("hive_metastore_url"));
options.put(FlinkOptions.HIVE_SYNC_JDBC_URL.key(), connectInfo.get("conn_url"));
options.put(FlinkOptions.HIVE_SYNC_SUPPORT_TIMESTAMP.key(), "true");
options.put(FlinkOptions.HIVE_SYNC_SKIP_RO_SUFFIX.key(), "true");

//compaction conf
options.put(FlinkOptions.COMPACTION_TASKS.key(), 4);
options.put(FlinkOptions.COMPACTION_TRIGGER_STRATEGY.key(), "num_or_time");
options.put(FlinkOptions.COMPACTION_DELTA_COMMITS.key(), "5");
options.put(FlinkOptions.COMPACTION_DELTA_SECONDS.key(), "300");
options.put(FlinkOptions.COMPACTION_MAX_MEMORY.key(), "1024");

select `_flink_cdc_ts_ms`,`_flink_cdc_table`,last_update_date from ods_rbs.ods_rbs_rbscmfprd_cmf_fin_acct_distributions_cdc a order by `_flink_cdc_ts_ms` desc limit 50;
+--------------------------+-----------------------------+------------------------+
| _flink_cdc_ts_ms | _flink_cdc_table | last_update_date |
+--------------------------+-----------------------------+------------------------+
| 2024-03-21 21:15:02.773 | cmf_fin_acct_distributions | 2024-03-21 18:05:02.0 |
| 2024-03-21 21:15:02.773 | cmf_fin_acct_distributions | 2024-03-21 18:05:02.0 |
| 2024-03-21 21:15:02.772 | cmf_fin_acct_distributions | 2024-03-21 18:05:02.0 |
| 2024-03-21 21:15:02.772 | cmf_fin_acct_distributions | 2024-03-21 18:03:07.0 |
| 2024-03-21 21:15:02.772 | cmf_fin_acct_distributions | 2024-03-21 18:03:43.0 |
| 2024-03-21 21:15:02.771 | cmf_fin_acct_distributions | 2024-03-21 18:03:00.0 |
| 2024-03-21 21:15:02.771 | cmf_fin_acct_distributions | 2024-03-21 18:02:49.0 |
| 2024-03-21 21:15:02.771 | cmf_fin_acct_distributions | 2024-03-21 18:02:08.0 |
| 2024-03-21 21:15:02.77 | cmf_fin_acct_distributions | 2024-03-21 18:02:08.0 |

**Expected behavior**

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

**Environment Description**

* Hudi version :

* Spark version :

* Hive version :

* Hadoop version :

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

* Running on Docker? (yes/no) :

**Additional context**

Add any other context about the problem here.

**Stacktrace**

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the listed FlinkOptions Hive-sync and compaction configuration, then compare the HDFS parquet generation times with the Hive RO-table query results. Reproduce the reported six-hour latency and use the Hive-sync configuration, sample query, and environment details to determine whether the latest data becomes visible as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering, databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.