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


##########
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:
   @YannByron set of required fields varies b/w different tables relying on 
making sure that we at least fetch fields to appropriate handle table's 
semantic. In MOR case such mandatory fields are exactly the record-key and 
pre-combine-key.



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