HyukjinKwon commented on a change in pull request #27888: [SPARK-31116][SQL] 
Consider case sensitivity in ParquetRowConverter
URL: https://github.com/apache/spark/pull/27888#discussion_r391979749
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
 ##########
 @@ -176,10 +177,22 @@ private[parquet] class ParquetRowConverter(
    */
   def currentRecord: InternalRow = currentRow
 
+
   // Converters for each field.
   private[this] val fieldConverters: Array[Converter with 
HasParentContainerUpdater] = {
+    // For letter case issue, create name to field index based on case 
sensitivity
+    val catalystFieldNameToIndex = if (caseSensitive) {
+      catalystType.fieldNames.zipWithIndex.toMap
+    } else {
+      CaseInsensitiveMap(catalystType.fieldNames.zipWithIndex.toMap)
+    }
+
     parquetType.getFields.asScala.map { parquetField =>
 
 Review comment:
   @kimtkyeom, can we add an if-else on 
`spark.sql.optimizer.nestedSchemaPruning.enabled`, and keep the very original 
codes 
https://github.com/apache/spark/pull/24307/files#diff-d07d3850a0ad8635a0c5562ed1e8bf26L185-L188?

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


With regards,
Apache Git Services

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

Reply via email to