YannByron commented on code in PR #5201:
URL: https://github.com/apache/hudi/pull/5201#discussion_r849151148


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieBaseRelation.scala:
##########
@@ -286,8 +319,16 @@ abstract class HoodieBaseRelation(val sqlContext: 
SQLContext,
   }
 
   protected final def appendMandatoryColumns(requestedColumns: Array[String]): 
Array[String] = {
-    val missing = mandatoryColumns.filter(col => 
!requestedColumns.contains(col))
-    requestedColumns ++ missing
+    if (dropPartitionColumnsWhenWrite) {
+      if (requestedColumns.isEmpty) {
+        mandatoryColumns.toArray
+      } else {
+        requestedColumns

Review Comment:
   1. actually, i can't understand why need to query additional mandatory 
columns in all the cases. If no column is required, we can fetch recordkey, and 
for mor merge, recordkey and precombineField. IMO, this is enough.
   
   2. if so, i can fix it. or just forbid enable this setting for mor table. 
after all, i don't think this setting is reasonable.



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