apache / apache/hudi

[SUPPORT] Looking for guidance on enabling CDC on an existing hudi table

Open
#13,319 4 comments 0 reactions 0 assignees View on GitHub
area:cdc area:sql
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/)? -> Page 404s

- 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 recently upgraded to hudi 0.15 and there are a number of tables that I'd like to enable the CDC feature on a number of table on a go-forward basis. So far I've tried:
- Adding `hoodie.table.cdc.enabled` `true` in my write properties
- Updating the `.hoodie/hoodie.properties` file to include `hoodie.table.cdc.enabled=true` and `hoodie.table.cdc.supplemental.logging.mode=DATA_BEFORE_AFTER` key/values.

I've been unable to find a migration strategy for updating existing hudi tables to enable CDC in the documentation or blog, but the documentation search appears to be broken so I may have missed something. Would someone be able to provide guidance on how they recommend to migrate an existing table to enable CDC? Is the only path to rewrite the entire table with a bulk insert?

**To Reproduce**

Steps to reproduce the behavior:

1. Have a non-cdc hudi table (ours were created with hudi 0.12)
2. Perform a write with the cdc flags turned on, or update the .hoodie.properties and then perform the writes
3. Read the table via `hudi_table_changes`
4. Hit `pyspark.errors.exceptions.captured.IllegalArgumentException: It isn't a CDC hudi table on`

**Expected behavior**

CDC data is provided for any writes that have happened since the setting was enabled

**Environment Description**

* Hudi version : 0.15.0

* Spark version : 3.5.2

* Hive version : Glue Catalog

* Hadoop version : N/A

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

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

**Additional context**

Performing the tests with an aws glue container

**Stacktrace**

```Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/spark/python/pyspark/sql/session.py", line 1631, in sql
return DataFrame(self._jsparkSession.sql(sqlQuery, litArgs), self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", line 1322, in __call__
File "/usr/lib/spark/python/pyspark/errors/exceptions/captured.py", line 185, in deco
raise converted from None
pyspark.errors.exceptions.captured.IllegalArgumentException: It isn't a CDC hudi table on s3://bucket/prefix```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no repository file or test; begin with the CDC configuration properties and the hudi_table_changes entry point, reproducing the reported failure on an existing table. Confirm the supported migration behavior for tables created before Hudi 0.15, then document the migration path and what CDC data should be available after enablement.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python, spark
Domain
cloud, data-engineering, documentation, stream-processing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.