You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/05/10 19:49:49 UTC

[GitHub] [hudi] l-jhon edited a comment on issue #2123: Timestamp not parsed correctly on Athena

l-jhon edited a comment on issue #2123:
URL: https://github.com/apache/hudi/issues/2123#issuecomment-837229546


   @jackye1995 Is it necessary to change something to make it work? Because I still have a problem.
   
   My code:
   
   `spark = SparkSession \
       .builder \
       .appName("data_ingestion_incremental_dev") \
       .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer") \
       .config("spark.sql.hive.convertMetastoreParquet", "false") \
       .config("spark.sql.session.timeZone", "America/Sao_Paulo") \
       .config("spark.hadoop.mapred.output.committer.class","com.appsflyer.spark.DirectOutputCommitter") \
       .config("mapreduce.fileoutputcommitter.marksuccessfuljobs", "false") \
       .config("spark.dynamicAllocation.enabled", "true") \
       .enableHiveSupport() \
       .getOrCreate()`
   
   table.write \
       .format("org.apache.hudi") \
       .option("hoodie.table.name", f"{data_source}_{table_name}") \
       .option("hoodie.datasource.write.table.type", "COPY_ON_WRITE") \
       .option("hoodie.datasource.write.operation", "INSERT") \
       .option("hoodie.datasource.write.recordkey.field", pk_column) \
       .option("hoodie.datasource.write.precombine.field", incremental_column) \
       .option("hoodie.datasource.write.keygenerator.class", "org.apache.hudi.keygen.CustomKeyGenerator") \
       .option("hoodie.datasource.write.partitionpath.field", "year:SIMPLE, month:SIMPLE, day:SIMPLE") \
       .option("hoodie.datasource.hive_sync.enable", True) \
        .option("hoodie.datasource.hive_sync.support_timestamp", True) \
       .option("hoodie.datasource.hive_sync.database", database_athena) \
       .option("hoodie.datasource.hive_sync.table", f"{data_source}_{table_name}") \
       .option("hoodie.datasource.hive_sync.partition_fields", "year, month, day") \
       .option("hoodie.datasource.hive_sync.partition_extractor_class", "org.apache.hudi.hive.MultiPartKeysValueExtractor") \
       .option("hoodie.consistency.check.enabled", True) \
       .option("hoodie.parquet.max.file.size", 1073741824) \
       .option("hoodie.parquet.small.file.limit", 629145600) \
       .option("hoodie.parquet.compression.codec", "snappy") \
       .option("hoodie.copyonwrite.insert.split.size", 500000) \
       .option("hoodie.copyonwrite.record.size.estimate", 1024) \
       .mode("overwrite") \
       .save(path_s3)
   `


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org