You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2025/06/04 15:10:15 UTC

[I] Spark Test fails `vectorized reader: missing all struct fields` [datafusion-comet]

comphead opened a new issue, #1843:
URL: https://github.com/apache/datafusion-comet/issues/1843

   ### Describe the bug
   
   when reading with the specified schema
   ```
     test("vectorized reader: missing all struct fields") {
       Seq(true, false).foreach { offheapEnabled =>
         withSQLConf(
           SQLConf.USE_V1_SOURCE_LIST.key -> "parquet",
           CometConf.COMET_EXEC_ENABLED.key -> "true",
           CometConf.COMET_ENABLED.key -> "true",
           CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.key -> "false",
           CometConf.COMET_NATIVE_SCAN_IMPL.key -> "native_datafusion",
           SQLConf.PARQUET_VECTORIZED_READER_NESTED_COLUMN_ENABLED.key -> "true",
           SQLConf.COLUMN_VECTOR_OFFHEAP_ENABLED.key -> offheapEnabled.toString) {
           val data = Seq(
             Tuple1((1, "a")),
             Tuple1((2, null)),
             Tuple1(null)
           )
   
           val readSchema = new StructType().add("_1",
             new StructType()
               .add("_3", IntegerType, nullable = true)
               .add("_4", LongType, nullable = true),
             nullable = true)
   
           withParquetFile(data) { file =>
             checkAnswer(spark.read.schema(readSchema).parquet(file),
               Row(null) :: Row(null) :: Row(null) :: Nil
             )
           }
         }
       }
     }
   ```
   
   The test fails on correctness issue
   
   ```
   !== Correct Answer - 3 ==   == Spark Answer - 3 ==
   !struct<>                   struct<_1:struct<_3:int,_4:bigint>>
   ![null]                     [[null,null]]
   ![null]                     [[null,null]]
    [null]                     [null]
   ```
   
   
   ### Steps to reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Spark Test fails `vectorized reader: missing all struct fields` [datafusion-comet]

Posted by "parthchandra (via GitHub)" <gi...@apache.org>.
parthchandra commented on issue #1843:
URL: https://github.com/apache/datafusion-comet/issues/1843#issuecomment-2950544301

   Sure.  FWI, I also think it is acceptable to document this as a incompatible result and leave it at that.


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Spark Test fails `vectorized reader: missing all struct fields` [datafusion-comet]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on issue #1843:
URL: https://github.com/apache/datafusion-comet/issues/1843#issuecomment-2949482569

   @parthchandra that would be my assumption too, but apparently Spark thinks if there is no overlap between columns in actual and expected schema just return null. I'll attach a PR soon and we can discuss more
   
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Spark Test fails `vectorized reader: missing all struct fields` [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed issue #1843: Spark Test fails `vectorized reader: missing all struct fields`
URL: https://github.com/apache/datafusion-comet/issues/1843


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Spark Test fails `vectorized reader: missing all struct fields` [datafusion-comet]

Posted by "parthchandra (via GitHub)" <gi...@apache.org>.
parthchandra commented on issue #1843:
URL: https://github.com/apache/datafusion-comet/issues/1843#issuecomment-2947362362

   Why would the expected result be `[null], [null], [null]` ? This means that all the structs are null but that is not the actual data. Only in the third row, is the struct actually null. 
   
   The data is equivalent to - 
   ```
   Row 1
     _1 :
         _1 : 1
        _2 : "a"
        _3 is missing (so is in fact null)
        _4 is missing (therefore also null)
   Row 2
   _1 :
         _1 : 2
         _2: null
        _3 is missing
        _4 is missing
   Row 3
   null
   ```
   So for Row 1 one would expect the value of the `struct _1` to be not null for row's 1 and 2. The fields _1._3 and _1._4 are not in the data (and the type for _1._4 does not match) so the values of those fields are in fact null. Looks like DF is correct.
   
   
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org