linliu-code commented on code in PR #9888:
URL: https://github.com/apache/hudi/pull/9888#discussion_r1371808655


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodiePartitionCDCFileGroupMapping.scala:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi
+
+import org.apache.hudi.common.model.HoodieFileGroupId
+import org.apache.hudi.common.table.cdc.HoodieCDCFileSplit
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.util.{ArrayData, MapData}
+import org.apache.spark.sql.types.{DataType, Decimal}
+import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String}
+
+import java.util
+
+case class HoodiePartitionCDCFileGroupMapping(partitionValues: InternalRow,
+                                              fileGroups: 
Map[HoodieFileGroupId, List[HoodieCDCFileSplit]]
+                                             ) extends InternalRow {
+
+  def getFileSplitsFor(fileGroupId: HoodieFileGroupId): 
Option[List[HoodieCDCFileSplit]] = {
+    fileGroups.get(fileGroupId)
+  }
+
+  override def numFields: Int = {
+    partitionValues.numFields
+  }
+
+  override def setNullAt(i: Int): Unit = {
+    partitionValues.setNullAt(i)
+  }
+
+  override def update(i: Int, value: Any): Unit = {
+    partitionValues.update(i, value)
+  }
+
+  override def copy(): InternalRow = {
+    HoodiePartitionCDCFileGroupMapping(partitionValues.copy(), fileGroups)
+  }
+
+  override def isNullAt(ordinal: Int): Boolean = {
+    partitionValues.isNullAt(ordinal)
+  }
+
+  override def getBoolean(ordinal: Int): Boolean = {
+    partitionValues.getBoolean(ordinal)
+  }
+
+  override def getByte(ordinal: Int): Byte = {
+    partitionValues.getByte(ordinal)
+  }
+
+  override def getShort(ordinal: Int): Short = {
+    partitionValues.getShort(ordinal)
+  }
+
+  override def getInt(ordinal: Int): Int = {
+    partitionValues.getInt(ordinal)
+  }
+
+  override def getLong(ordinal: Int): Long = {
+    partitionValues.getLong(ordinal)
+  }
+
+  override def getFloat(ordinal: Int): Float = {
+    partitionValues.getFloat(ordinal)
+  }
+
+  override def getDouble(ordinal: Int): Double = {
+    partitionValues.getDouble(ordinal)
+  }
+
+  override def getDecimal(ordinal: Int, precision: Int, scale: Int): Decimal = 
{
+    partitionValues.getDecimal(ordinal, precision, scale)
+  }
+
+  override def getUTF8String(ordinal: Int): UTF8String = {
+    partitionValues.getUTF8String(ordinal)
+  }
+
+  override def getBinary(ordinal: Int): Array[Byte] = {
+    partitionValues.getBinary(ordinal)
+  }
+
+  override def getInterval(ordinal: Int): CalendarInterval = {
+    partitionValues.getInterval(ordinal)
+  }
+
+  override def getStruct(ordinal: Int, numFields: Int): InternalRow = {
+    partitionValues.getStruct(ordinal, numFields)
+  }
+
+  override def getArray(ordinal: Int): ArrayData = {
+    partitionValues.getArray(ordinal)
+  }
+
+  override def getMap(ordinal: Int): MapData = {
+    partitionValues.getMap(ordinal)
+  }
+
+  override def get(ordinal: Int, dataType: DataType): AnyRef = {
+    partitionValues.getMap(ordinal)

Review Comment:
   Right. Let me fix.



-- 
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-unsubscr...@hudi.apache.org

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

Reply via email to