ankitsultana commented on code in PR #13748:
URL: https://github.com/apache/pinot/pull/13748#discussion_r1735513723


##########
pinot-connectors/pinot-spark-3-connector/src/main/scala/org/apache/pinot/connector/spark/v3/datasource/PinotBufferedRecordReader.scala:
##########
@@ -0,0 +1,68 @@
+/**
+ * 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.pinot.connector.spark.v3.datasource
+
+import org.apache.pinot.spi.data.readers.{GenericRow, RecordReader, 
RecordReaderConfig}
+
+import java.io.File
+import java.util
+
+/**
+ * A buffered record reader that stores the records in memory and allows for 
iteration over them.
+ * This is useful to satisfy the RecordReader interface in Pinot, and also 
allow for Spark executor
+ * to write records.
+ *
+ * TODO: To improve resilience, write records to disk when memory is full.
+ */
+class PinotBufferedRecordReader extends RecordReader {
+  private val recordBuffer = new util.ArrayList[GenericRow]()
+  private var readCursor = 0
+
+  def init(dataFile: File, fieldsToRead: util.Set[String], recordReaderConfig: 
RecordReaderConfig): Unit = {

Review Comment:
   can we add a todo here? Looks like we are not honoring fieldsToRead.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to