rangareddy commented on issue #10678:
URL: https://github.com/apache/hudi/issues/10678#issuecomment-4843425406

   Hi @ofinchuk-bloomberg 
   
   I have provided an alternative solution for your issue. If this looks okay, 
we can close the issue.
   
   ```python
   table_path = "/tmp/hudi_10678_simple_redesign"
   
   df = df.withColumn("part_hour", 
F.date_format(F.timestamp_millis(F.col("ts")), "yyyyMMdd-HH"))
   df.printSchema()
   
   print("Workaround — dedicated string partition column")
   
   (df.write.format("hudi")
      .option("hoodie.table.name", "t10678_d")
      .option("hoodie.datasource.write.keygenerator.class", 
"org.apache.hudi.keygen.SimpleKeyGenerator")
      .option("hoodie.datasource.write.partitionpath.field", "part_hour")   # 
native STRING
      .option("hoodie.datasource.write.recordkey.field", "id")
      .option("hoodie.datasource.write.precombine.field", "name")
      .option("hoodie.datasource.write.hive_style_partitioning", "true")
      .mode("overwrite")
      .save(table_path))
   
   spark.read.format("hudi").load(table_path).show(truncate=False)
   ```


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