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

spark cannot read mor table after execute update statement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Unresolved
    • 0.13.0
    • 0.13.1
    • spark

    Description

      avro schema create by sparksql miss avro name and namespace, 

      This will lead the read schema and write schema of the log file to be incompatible

       

      // code placeholder
       spark.sql(
         s"""
            |create table $tableName (
            |  id int,
            |  name string,
            |  price double,
            |  ts long,
            |  ff decimal(38, 10)
            |) using hudi
            | location '${tablePath.toString}'
            | tblproperties (
            |  type = 'mor',
            |  primaryKey = 'id',
            |  preCombineField = 'ts'
            | )
      """.stripMargin)
       spark.sql(s"insert into $tableName select 1, 'a1', 10, 1000, 10.0")
      checkAnswer(s"select id, name, price, ts from $tableName")(
        Seq(1, "a1", 10.0, 1000)
      )
      spark.sql(s"update $tableName set price = 22 where id = 1")
      checkAnswer(s"select id, name, price, ts from $tableName")(   -------- failed
        Seq(1, "a1", 22.0, 1000)
      )
      
      

       

      Attachments

        Issue Links

          Activity

            People

              mengtao Tao Meng
              mengtao Tao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: