You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "Dakarun (via GitHub)" <gi...@apache.org> on 2025/05/19 14:21:35 UTC
[I] [SUPPORT] Looking for guidance on enabling CDC on an existing hudi table [hudi]
Dakarun opened a new issue, #13319:
URL: https://github.com/apache/hudi/issues/13319
**_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 "<stdin>", line 1, in <module>
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```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Looking for guidance on enabling CDC on an existing hudi table [hudi]
Posted by "Dakarun (via GitHub)" <gi...@apache.org>.
Dakarun commented on issue #13319:
URL: https://github.com/apache/hudi/issues/13319#issuecomment-2923050899
Thanks @rangareddy. Do you happen to know if I should expect the current "workaround" (e.g. my previous comment about a filesystem based read) to stop working in future versions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Looking for guidance on enabling CDC on an existing hudi table [hudi]
Posted by "rangareddy (via GitHub)" <gi...@apache.org>.
rangareddy commented on issue #13319:
URL: https://github.com/apache/hudi/issues/13319#issuecomment-2922291113
Hi @Dakarun
Implementing CDC on existing tables is not directly feasible. The recommended approach is to create a new table based on the existing data, then drop the original table and rename the newly created table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Looking for guidance on enabling CDC on an existing hudi table [hudi]
Posted by "Dakarun (via GitHub)" <gi...@apache.org>.
Dakarun commented on issue #13319:
URL: https://github.com/apache/hudi/issues/13319#issuecomment-2891673531
I did manage to get it running using a filesystem read, i.e.
```
spark.read.format("hudi") \
.option("hoodie.datasource.query.type", "incremental") \
.option("hoodie.datasource.query.incremental.format", "cdc") \
.option("hoodie.datasource.read.begin.instanttime", "from") \
.option("hoodie.datasource.read.end.instanttime", "to") \
.load("s3://bucket/prefix/")
```
So it does seem the writers started producing cdc files. Read's through sql still fail however.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Looking for guidance on enabling CDC on an existing hudi table [hudi]
Posted by "rangareddy (via GitHub)" <gi...@apache.org>.
rangareddy commented on issue #13319:
URL: https://github.com/apache/hudi/issues/13319#issuecomment-3223772586
Hi @Dakarun
To migrate a non-CDC table to a CDC table, please follow these steps:
1. Create a new Hudi table with `hoodie.table.cdc.enabled=true`.
2. Copy (rewrite) the data from the old table to the new table.
3. Use the new table for future writes and CDC queries.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org