AngersZhuuuu opened a new pull request #30840:
URL: https://github.com/apache/spark/pull/30840


   ### What changes were proposed in this pull request?
   
   Currently when enable parquet vectorized reader, use binary type as 
partition col will return incorrect value as below UT
   ```scala
   test("Parquet vector reader incorrect with binary partition value") {
     Seq(false, true).foreach(tag => {
       withSQLConf("spark.sql.parquet.enableVectorizedReader" -> tag.toString) {
         withTable("t1") {
           sql(
             """CREATE TABLE t1(name STRING, id BINARY, part BINARY)
               | USING PARQUET PARTITIONED BY (part)""".stripMargin)
           sql(s"INSERT INTO t1 PARTITION(part = 'Spark SQL') VALUES('a', 
X'537061726B2053514C')")
           if (tag) {
             checkAnswer(sql("SELECT name, cast(id as string), cast(part as 
string) FROM t1"),
               Row("a", "Spark SQL", ""))
           } else {
             checkAnswer(sql("SELECT name, cast(id as string), cast(part as 
string) FROM t1"),
               Row("a", "Spark SQL", "Spark SQL"))
           }
         }
       }
     })
   }
   ```
   
   
   ### Why are the changes needed?
   Fix data incorrect issue
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Added UT
   


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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to