danny0405 commented on code in PR #8432:
URL: https://github.com/apache/hudi/pull/8432#discussion_r1176127485
##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieInternalRowUtils.scala:
##########
@@ -224,29 +224,32 @@ object HoodieInternalRowUtils {
fieldNameStack.pop()
(fieldUpdater, ordinal, value) => {
- val prevArrayData = value.asInstanceOf[ArrayData]
- val prevArray = prevArrayData.toObjectArray(prevElementType)
-
- 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)
+
Review Comment:
Could we fix line 191 instead, that could fix all the data type with null
values, covering also the atomic data types.
--
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]