magnus-ISU opened a new issue, #6152:
URL: https://github.com/apache/hudi/issues/6152
**Describe the problem you faced**
When writing data (from amazon DMS for example)
'hoodie.datasource.write.payload.class' =
'org.apache.hudi.payload.AWSDmsAvroPayload' the 'Op' column is written to hudi,
but I would like it to not be there. The data is being written to a table which
will be queried by analysts who don't need to know the last operation on the
data.
**To Reproduce**
Steps to reproduce the behavior:
Using pyspark:
Create a dataframe `df` and set variables `s3_bucket_output, table_output,
record_key` etc accordingly. Or use Hudi in any other way, I can't imagine this
is specific to AWS Glue.
```
hoodie_options = {
'hoodie.table.name': table_output,
'hoodie.datasource.write.recordkey.field': record_key,
'hoodie.datasource.write.partitionpath.field': partition_field,
'hoodie.datasource.hive_sync.enable': 'true',
'hoodie.datasource.hive_sync.database': database_output,
'hoodie.datasource.hive_sync.auto_create_database': 'true',
'hoodie.datasource.write.precombine.field': precombine_field,
'hoodie.datasource.hive_sync.table': table_output,
'hoodie.datasource.hive_sync.partition_fields': partition_field,
'hoodie.datasource.hive_sync.use_jdbc':'false',
'hoodie.datasource.hive_sync.partition_extractor_class':
'org.apache.hudi.hive.MultiPartKeysValueExtractor',
'hoodie.meta.sync.classes':
'org.apache.hudi.aws.sync.AwsGlueCatalogSyncTool',
'hoodie.index.type': 'GLOBAL_BLOOM',
'hoodie.bloom.index.update.partition.path': 'true',
'hoodie.datasource.read.schema.use.end.instanttime': 'true',
'hoodie.datasource.write.reconcile.schema': 'true',
'hoodie.datasource.write.payload.class':
'org.apache.hudi.payload.AWSDmsAvroPayload',
'hoodie.datasource.write.precombine.field': record_key,
}
df.write \
.format('org.apache.hudi') \
.options(hoodie_options) \
.mode('append') \
.save(f's3://{s3_bucket_output}/{database_output}/{table_output}')
```
**Expected behavior**
There is a setting to remove this column, or a different payload class which
can do so.
**Environment Description**
* Hudi version: Unsure, how do I find out?
* Spark version: Whatever version AWS Glue Jobs come with
* Hive version: Unsure
* Hadoop version: Unsure
* Storage (HDFS/S3/GCS..) : S3
* Running on Docker? (yes/no) : no
**Additional context**
It appears no such option exists. But it would be simple to extend the
payload class
[here](https://github.com/apache/hudi/blob/ba4e732ba75e12a02d07c09f2662678bdcafbdc2/hudi-spark-datasource/hudi-spark/src/main/java/org/apache/hudi/payload/AWSDmsAvroPayload.java)
to do so, to just drop the column in handleDeleteOperation near line 69.
However, I am using pyspark with AWS glue and thus am unsure if I am able to
do so easily.
If I did so, would a merge request be accepted?
Also, I am extremely bad at using hudi. If I am doing anything else strange
in the options I am setting, let me know. Some things feel very strange to me,
but it will crash with a useless error message if I don't do them. For example,
I think, the record key as precombine field.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]