Uploaded image for project: 'Apache Hudi'
  1. Apache Hudi
  2. HUDI-7796

Gracefully cast file system instance in Avro writers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.15.0, 1.0.0
    • None
    • 1

    Description

      When running tests in Trino with Hudi MDT enabled, the following line in HoodieAvroHFileWriter throws class cast exception, since Trino uses dependency injection to provide the Hadoop file system instance, which may skip the Hudi wrapper file system logic.

          this.fs = (HoodieWrapperFileSystem) this.file.getFileSystem(conf); 
      Caused by: java.lang.ClassCastException: class io.trino.hdfs.TrinoFileSystemCache$FileSystemWrapper cannot be cast to class org.apache.hudi.hadoop.fs.HoodieWrapperFileSystem (io.trino.hdfs.TrinoFileSystemCache$FileSystemWrapper and org.apache.hudi.hadoop.fs.HoodieWrapperFileSystem are in unnamed module of loader 'app')
          at org.apache.hudi.io.hadoop.HoodieAvroHFileWriter.<init>(HoodieAvroHFileWriter.java:91)
          at org.apache.hudi.io.hadoop.HoodieAvroFileWriterFactory.newHFileFileWriter(HoodieAvroFileWriterFactory.java:108)
          at org.apache.hudi.io.storage.HoodieFileWriterFactory.getFileWriterByFormat(HoodieFileWriterFactory.java:70)
          at org.apache.hudi.io.storage.HoodieFileWriterFactory.getFileWriter(HoodieFileWriterFactory.java:53)
          at org.apache.hudi.io.HoodieCreateHandle.<init>(HoodieCreateHandle.java:108)
          at org.apache.hudi.io.HoodieCreateHandle.<init>(HoodieCreateHandle.java:77)
          at org.apache.hudi.io.CreateHandleFactory.create(CreateHandleFactory.java:45)
          at org.apache.hudi.execution.CopyOnWriteInsertHandler.consume(CopyOnWriteInsertHandler.java:101)
          at org.apache.hudi.execution.CopyOnWriteInsertHandler.consume(CopyOnWriteInsertHandler.java:44) 

      Attachments

        Activity

          People

            guoyihua Ethan Guo (this is the old account; please use "yihua")
            guoyihua Ethan Guo (this is the old account; please use "yihua")
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: