danny0405 commented on code in PR #5825:
URL: https://github.com/apache/hudi/pull/5825#discussion_r897629951


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/payload/ExpressionPayload.scala:
##########
@@ -318,5 +305,26 @@ object ExpressionPayload {
         }
       })
   }
+
+  private val mergedSchemaCache = CacheBuilder.newBuilder().build[TupleSchema, 
Schema]()
+
+  def getMergedSchema(source: Schema, target: Schema): Schema = {
+
+    mergedSchemaCache.get(TupleSchema(source, target), new Callable[Schema] {
+      override def call(): Schema = {
+        val noMetaRight = HoodieAvroUtils.removeMetadataFields(target)
+        val mergedFields =

Review Comment:
   `noMetaRight` -> `rightSchema`
   
   I would suggest you keep the `mergeSchema` method, and `getMergedSchema` can 
call this method to make the logic more clear.



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