lokeshj1703 commented on code in PR #11710:
URL: https://github.com/apache/hudi/pull/11710#discussion_r1742877263


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieReaderFileIndex.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.table.{HoodieTableConfig, HoodieTableMetaClient}
+import org.apache.hudi.keygen.CustomAvroKeyGenerator.PartitionKeyType
+import org.apache.hudi.keygen.constant.KeyGeneratorType
+import org.apache.hudi.keygen.{CustomAvroKeyGenerator, KeyGenUtils}
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.expressions.Expression
+import org.apache.spark.sql.execution.datasources.{FileStatusCache, NoopCache, 
PartitionDirectory}
+import org.apache.spark.sql.types.StructType
+
+class HoodieReaderFileIndex(override val spark: SparkSession,

Review Comment:
   Addressed



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieReaderFileIndex.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.table.{HoodieTableConfig, HoodieTableMetaClient}
+import org.apache.hudi.keygen.CustomAvroKeyGenerator.PartitionKeyType
+import org.apache.hudi.keygen.constant.KeyGeneratorType
+import org.apache.hudi.keygen.{CustomAvroKeyGenerator, KeyGenUtils}
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.expressions.Expression
+import org.apache.spark.sql.execution.datasources.{FileStatusCache, NoopCache, 
PartitionDirectory}
+import org.apache.spark.sql.types.StructType
+
+class HoodieReaderFileIndex(override val spark: SparkSession,

Review Comment:
   Yes, that is expected. I have generalized the changes to separate out a 
reader file index. The reader file index only does some extra handling for 
custom keygen and otherwise maintains the same functionality as HoodieFileIndex.



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieReaderFileIndex.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.table.{HoodieTableConfig, HoodieTableMetaClient}
+import org.apache.hudi.keygen.CustomAvroKeyGenerator.PartitionKeyType
+import org.apache.hudi.keygen.constant.KeyGeneratorType
+import org.apache.hudi.keygen.{CustomAvroKeyGenerator, KeyGenUtils}
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.expressions.Expression
+import org.apache.spark.sql.execution.datasources.{FileStatusCache, NoopCache, 
PartitionDirectory}
+import org.apache.spark.sql.types.StructType
+
+class HoodieReaderFileIndex(override val spark: SparkSession,
+                            override val metaClient: HoodieTableMetaClient,
+                            override val schemaSpec: Option[StructType],
+                            override val options: Map[String, String],
+                            @transient override val fileStatusCache: 
FileStatusCache = NoopCache,
+                            override val includeLogFiles: Boolean = false,
+                            override val shouldEmbedFileSlices: Boolean = 
false)
+  extends HoodieFileIndex(
+    spark = spark,
+    metaClient = metaClient,
+    schemaSpec = schemaSpec,
+    options = options,
+    fileStatusCache = fileStatusCache,
+    includeLogFiles = includeLogFiles,
+    shouldEmbedFileSlices = shouldEmbedFileSlices) {
+
+  /**
+   *
+   * Returns set of indices with timestamp partition type. For Timestamp based 
keygen, there is only one
+   * partition so index is 0. For custom keygen, it is the partition indices 
for which partition type is
+   * timestamp.
+   */
+  private def getTimestampPartitionIndex(): Set[Int] = {

Review Comment:
   Addressed



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