roSimoes commented on issue #4552:
URL: https://github.com/apache/hudi/issues/4552#issuecomment-1088443335

   Hello @nsivabalan,  I have the same problem.
   The solution presented here solves the problem for the bulk insert but the 
upsert remains the same.
   
   In my case I have a job that on the 1st load does bulk_insert and then 
inserts data on new loads, all these new loads have dates from 1970.
   
   I'll leave my configs attached:
   **Initial Load :**
   commonConfig = {'className' : 'org.apache.hudi', 
                   'hoodie.datasource.hive_sync.use_jdbc':'false', 
                   'hoodie.datasource.write.precombine.field': 'updated_date', 
                   'hoodie.datasource.write.recordkey.field': primaryKey, 
                   'hoodie.table.name': tableName, 
                   'hoodie.consistency.check.enabled': 'true', 
                   'hoodie.datasource.hive_sync.database': database, 
                   'hoodie.datasource.hive_sync.table': tableName, 
                   'hoodie.datasource.hive_sync.enable': 'true', 
                   "hoodie.datasource.hive_sync.support_timestamp": "true",
                   'path': targetPath
                   }
   
   partitionDataConfig = {'hoodie.datasource.write.partitionpath.field': 
partitionKey, 
                          
'hoodie.datasource.hive_sync.partition_extractor_class': 
'org.apache.hudi.hive.MultiPartKeysValueExtractor', 
                          'hoodie.datasource.hive_sync.partition_fields': 
partitionKey
                         }
   
   initLoadConfig = {'hoodie.bulkinsert.shuffle.parallelism': 68, 
                     'hoodie.datasource.write.operation': 'bulk_insert',
                     'hoodie.datasource.write.payload.class': 
'org.apache.hudi.common.model.EmptyHoodieRecordPayload',
                     'hoodie.datasource.write.partitions.to.delete': targetPath,
                     'hoodie.parquet.outputtimestamptype' : 'TIMESTAMP_MICROS'
                     }
   
   combinedConf = {**commonConfig, **partitionDataConfig, **initLoadConfig}
   
   
   glueContext.write_dynamic_frame.from_options(frame = DataSource0, 
connection_type = "marketplace.spark", connection_options = combinedConf)
   
   
   
   **Incremental Load :**
   
   commonConfig = {'className' : 'org.apache.hudi', 
                                'hoodie.datasource.hive_sync.use_jdbc':'false', 
                                'hoodie.datasource.write.precombine.field': 
'updated_date', 
                                'hoodie.datasource.write.recordkey.field': 
primaryKey, 
                                'hoodie.table.name': tableName, 
                                'hoodie.consistency.check.enabled': 'true', 
                                'hoodie.datasource.hive_sync.database': 
database, 
                                'hoodie.datasource.hive_sync.table': tableName, 
                                'hoodie.datasource.hive_sync.enable': 'true', 
                                
'hoodie.datasource.hive_sync.support_timestamp': 'true',
                                'path': targetPath
                                }
                                
   partitionDataConfig = {'hoodie.datasource.write.partitionpath.field': 
partitionKey, 
                                        
'hoodie.datasource.hive_sync.partition_extractor_class': 
'org.apache.hudi.hive.MultiPartKeysValueExtractor', 
                                        
'hoodie.datasource.hive_sync.partition_fields': partitionKey
                                        }
                                        
   incrementalConfig = {'hoodie.upsert.shuffle.parallelism': 20, 
                                        'hoodie.datasource.write.operation': 
'upsert', 
                                        'hoodie.cleaner.policy': 
'KEEP_LATEST_COMMITS',
                                        'hoodie.parquet.outputtimestamptype' : 
'TIMESTAMP_MICROS'
                                        }
                                        
   combinedConf = {**commonConfig, **partitionDataConfig, **incrementalConfig}
   
   DataSink0 = glueContext.write_dynamic_frame.from_options(frame = 
DynamicFrame.fromDF(DataSourceDF0, glueContext, "initDf"), connection_type = 
"marketplace.spark", connection_options = combinedConf)
   
   
   Would it be possible for you to help me?
   thanks in advance


-- 
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]

Reply via email to