hudi-bot opened a new issue, #15066:
URL: https://github.com/apache/hudi/issues/15066

   now, when we use sparksql to update hudi table, we find that  hudi will 
change the nullability attribute of a column
   
   eg:
   {code:java}
   // code placeholder
    val tableName = generateTableName
    val tablePath = s"${new Path(tmp.getCanonicalPath, 
tableName).toUri.toString}"
    // create table
    spark.sql(
      s"""
         |create table $tableName (
         |  id int,
         |  name string,
         |  price double,
         |  ts long
         |) using hudi
         | location '$tablePath'
         | options (
         |  type = '$tableType',
         |  primaryKey = 'id',
         |  preCombineField = 'ts'
         | )
   """.stripMargin)
    // insert data to table
    spark.sql(s"insert into $tableName select 1, 'a1', 10, 1000")
    spark.sql(s"select * from $tableName").printSchema()
   
    // update data
    spark.sql(s"update $tableName set price = 20 where id = 1")
    spark.sql(s"select * from $tableName").printSchema() {code}
    
   
    |-- _hoodie_commit_time: string (nullable = true)
    |-- _hoodie_commit_seqno: string (nullable = true)
    |-- _hoodie_record_key: string (nullable = true)
    |-- _hoodie_partition_path: string (nullable = true)
    |-- _hoodie_file_name: string (nullable = true)
    |-- id: integer (nullable = true)
    |-- name: string (nullable = true)
    *|-- price: double (nullable = true)*
    |-- ts: long (nullable = true)
   
    
   
    |-- _hoodie_commit_time: string (nullable = true)
    |-- _hoodie_commit_seqno: string (nullable = true)
    |-- _hoodie_record_key: string (nullable = true)
    |-- _hoodie_partition_path: string (nullable = true)
    |-- _hoodie_file_name: string (nullable = true)
    |-- id: integer (nullable = true)
    |-- name: string (nullable = true)
    *|-- price: double (nullable = false )*
    |-- ts: long (nullable = true)
    
   the nullable attribute of price has been changed to false, This is not the 
result we want
   
   ## JIRA info
   
   - Link: https://issues.apache.org/jira/browse/HUDI-3646
   - Type: Bug
   - Affects version(s):
     - 0.10.1
   - Fix version(s):
     - 1.1.0


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