[ 
https://issues.apache.org/jira/browse/SPARK-39484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17554777#comment-17554777
 ] 

Apache Spark commented on SPARK-39484:
--------------------------------------

User 'edgarRd' has created a pull request for this issue:
https://github.com/apache/spark/pull/36881

> V2 write for type struct fails to handle case sensitivity on field names 
> during resolution of V2 write command
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-39484
>                 URL: https://issues.apache.org/jira/browse/SPARK-39484
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.1.1, 3.2.1
>         Environment: {{{}master{}}}, {{3.1.1}}
>            Reporter: Edgar Rodriguez
>            Priority: Minor
>
> Summary:
> When a V2 write uses an input with a {{struct}} type which contains 
> differences in the casing of field names, the {{caseSensitive}} config is not 
> being honored, always doing a strict case sensitive comparison.
> Repro:
> {code:java}
> CREATE TABLE tmp.test_table_to (key int, object struct<shardId:int>) USING 
> ICEBERG;
> CREATE TABLE tmp.test_table_from (key int, object struct<shardid:int>) USING 
> HIVE;
> INSERT OVERWRITE tmp.test_table_to SELECT 1 as key, object FROM 
> tmp.test_table_from;{code}
> The above results in Exception:
> {code:java}
> Error in query: unresolved operator 'OverwriteByExpression RelationV2[key#3, 
> object#4] spark_catalog.tmp.test_table_to, true, false;
> 'OverwriteByExpression RelationV2[key#3, object#4] 
> spark_catalog.tmp.test_table_to, true, false
> +- Project [1 AS key#0, object#2]
>    +- SubqueryAlias spark_catalog.tmp.test_table_from
>       +- HiveTableRelation [`tmp`.`test_table_from`, 
> org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe, Data Cols: 
> [key#1, object#2], Partition Cols: []]{code}
>  
> If the casing matches in the struct field names, the v2 write works as 
> expected.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to