jackwang2 opened a new issue #630: Read RO View Exception: unable to infer 
schema for Parquet. It must be specified manually
URL: https://github.com/apache/incubator-hudi/issues/630
 
 
   ```
       df1.dropDuplicates("event_id")
         .write
         .format("com.uber.hoodie")
         .mode(SaveMode.Append)
         .option(DataSourceWriteOptions.RECORDKEY_FIELD_OPT_KEY, "event_id")
         .option(DataSourceWriteOptions.PARTITIONPATH_FIELD_OPT_KEY, "st")
         .option(DataSourceWriteOptions.OPERATION_OPT_KEY, 
DataSourceWriteOptions.UPSERT_OPERATION_OPT_VAL)
         .option(HoodieWriteConfig.TABLE_NAME, "mytb")
         .option(DataSourceWriteOptions.PRECOMBINE_FIELD_OPT_KEY, "timestamp")
         .option("hoodie.insert.shuffle.parallelism",100)
         .save("s3a://my-bucket/temp/jack-test/result1")
   
   ```
   
   I can used above code to upsert json data and write parquet successfully, 
but when try to read data by RO view, it always excpetion:
   
   ```
   val df2 = 
spark.read.format("com.uber.hoodie").load("s3a://my-bucket/temp/jack-test/result1")
   df2.show(false)
   
   ```
   
   org.apache.spark.sql.AnalysisException: Unable to infer schema for Parquet. 
It must be specified manually.;
     at 
org.apache.spark.sql.execution.datasources.DataSource$$anonfun$9.apply(DataSource.scala:208)
     at 
org.apache.spark.sql.execution.datasources.DataSource$$anonfun$9.apply(DataSource.scala:208)
     at scala.Option.getOrElse(Option.scala:121)
     at 
org.apache.spark.sql.execution.datasources.DataSource.getOrInferFileFormatSchema(DataSource.scala:207)
     at 
org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:393)
     at com.uber.hoodie.DefaultSource.createRelation(DefaultSource.scala:81)
     at com.uber.hoodie.DefaultSource.createRelation(DefaultSource.scala:46)
     at 
org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:341)
     at 
org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:239)
     at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:227)
     at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:174)
     ... 58 elided
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to