You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "parisni (via GitHub)" <gi...@apache.org> on 2023/04/13 07:47:44 UTC

[GitHub] [hudi] parisni commented on pull request #8432: [HUDI-6072] Fix NPE when upsert merger and null map or array

parisni commented on PR #8432:
URL: https://github.com/apache/hudi/pull/8432#issuecomment-1506506559

   Tests based on the spark datasource api (similar to the eg in the OP) or do you have a better idea?
   
   On April 13, 2023 6:35:17 AM UTC, Danny Chan ***@***.***> wrote:
   >@danny0405 commented on this pull request.
   >
   >
   >
   >> -          val newArrayData = createArrayData(newElementType, prevArrayData.numElements())
   >-          val elementUpdater = new ArrayDataUpdater(newArrayData)
   >-
   >-          var i = 0
   >-          while (i < prevArray.length) {
   >-            val element = prevArray(i)
   >-            if (element == null) {
   >-              if (!containsNull) {
   >-                throw new HoodieException(
   >-                  s"Array value at path '${fieldNameStack.asScala.mkString(".")}' is not allowed to be null")
   >+          if (value == null) {
   >+            fieldUpdater.setNullAt(ordinal)
   >+          } else {
   >+            val prevArrayData = value.asInstanceOf[ArrayData]
   >+            val prevArray = prevArrayData.toObjectArray(prevElementType)
   >+
   >
   >Thanks for the contribution, can we add some test cases?
   >
   >-- 
   >Reply to this email directly or view it on GitHub:
   >https://github.com/apache/hudi/pull/8432#pullrequestreview-1382731324
   >You are receiving this because you authored the thread.
   >
   >Message ID: ***@***.***>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org