Skip to content

[native_datafusion] No support for default values for Parquet columns #1750

@andygrove

Description

@andygrove

Describe the bug

native_datafusion produces incorrect results when reading Parquet for columns that contain null and have a default value assigned.

Steps to reproduce

Add this test to CometExpressionSuite:

  test("parquet default values") {
    withTable("t1") {
      sql(s"create table t1(col1 boolean) using parquet")
      sql(s"insert into t1 values(true)")
      sql(s"alter table t1 add column col2 string default 'hello'")
      checkSparkAnswerAndOperator("select * from t1")
    }
  }

Results:

!== Correct Answer - 1 ==           == Spark Answer - 1 ==
 struct<col1:boolean,col2:string>   struct<col1:boolean,col2:string>
![true,hello]                       [true,null]

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions