Flyangz opened a new issue, #1610:
URL: https://github.com/apache/auron/issues/1610

   **Describe the bug**
   If a SQL query uses an uppercase column name (e.g., SELECT NAME FROM 
my_table) and the scan node is `HiveTableScanExec`, the `requestedAttributes` 
in `HiveTableScanExec` keeps the column name as "NAME". It then fails to match 
this with the actual column name "name" (in lowercase) in the following code.
   
https://github.com/apache/auron/blob/208024d01019de0079f263020282420f32cb3508/spark-extension/src/main/scala/org/apache/spark/sql/hive/execution/auron/plan/NativeHiveTableScanBase.scala#L73
   This scenario is uncommon in Auron, as NativeFileSourceScanBase is not 
frequently used. We encountered this because our internal version of Auron 
supports other data sources. Auron might run into this bug when using Paimon or 
in other future scenarios that utilize NativeFileSourceScanBase.
   
   
   **To Reproduce**
   In vanilla Spark 3.2, we can see the  
`HiveTableScanExec.requestedAttributes` remain the "K" instead of "k".
   ```
   spark.sql("drop table if exists test.my_table")
   spark.sql(
     """
       |create table test.my_table (
       |    k string,
       |    v string
       |) stored as textfile
       |""".stripMargin)
   spark.sql(
     """
       |INSERT INTO test.my_table VALUES('a', 'b')
       |""".stripMargin)
   spark.sql("select K from test.my_table").show()
   ```
   
   **Expected behavior**
   `NativeFileSourceScanBase.nativeFileSchema` can handle uppercase column name 
like `NativeFileSourceScanBase`'s.
   
   
   


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