wjcwin edited a comment on issue #4678:
URL: https://github.com/apache/hudi/issues/4678#issuecomment-1033556404


   > @wjcwin can you give some details like codes and your expected result. 
that will help us to locate this issue.
   
   ```
     def getHudi(spark: SparkSession, path: String, dataSchema: StructType): 
DataFrame = {
       val df: DataFrame =
         spark.read.format("hudi")
           .schema(dataSchema)
           .load(path + "/*")
       df
     }
   
     def getHudi(spark: SparkSession, path: String): DataFrame = {
       var df: DataFrame =
         spark.read.format("org.apache.hudi")
           .load(path + "/*")
           .select("pay_time")
       val swithcSchema = switchSchema(df)
       df = getHudi(spark, path, swithcSchema)
       df
     }
   
     def switchSchema(df: DataFrame): StructType = {
       val orgSchema = df.schema
       orgSchema.printTreeString()
       val swithcSchema = StructType(orgSchema.map(f =>
         if (f.dataType == DataTypes.TimestampType) {
           StructField(f.name, DataTypes.LongType)
         } else {
           f
         }
       ))
       swithcSchema.printTreeString()
       swithcSchema
     }
   ```
   i just want to convert DataTypes.TimestampType to DataTypes.LongType ,  when 
i use hudi.version 0.5.3 ,i got expect
   but when i use hudi.version 0.10.0 , result is not expect
   
   


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