cloud-fan commented on a change in pull request #32777:
URL: https://github.com/apache/spark/pull/32777#discussion_r648487659



##########
File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdater.java
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.spark.sql.execution.datasources.parquet;
+
+import org.apache.parquet.column.Dictionary;
+
+import org.apache.spark.sql.execution.vectorized.WritableColumnVector;
+
+public interface ParquetVectorUpdater {
+  /**
+   * Read a batch of `total` values from `valuesReader` into `values`, 
starting from `offset`.
+   *
+   * @param total total number of values to read
+   * @param offset starting offset in `values`
+   * @param values destination values vector
+   * @param valuesReader reader to read values from
+   */
+  void updateBatch(
+      int total,
+      int offset,
+      WritableColumnVector values,
+      VectorizedValuesReader valuesReader);
+
+  /**
+   * Read a single value from `valuesReader` into `values`, at `offset`.
+   *
+   * @param offset offset in `values` to put the new value
+   * @param values destination value vector
+   * @param valuesReader reader to read values from
+   */
+  void update(int offset, WritableColumnVector values, VectorizedValuesReader 
valuesReader);
+
+  /**
+   * Decode a batch of `total` dictionary IDs from `dictionaryIds` into 
`values` starting at
+   * `offset`, using `dictionary`.

Review comment:
       let's mention the null behavior in the doc: Some slots in `values` can 
be null, which means the value is already filled and we don't need to read from 
the dictionary.

##########
File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdater.java
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.spark.sql.execution.datasources.parquet;
+
+import org.apache.parquet.column.Dictionary;
+
+import org.apache.spark.sql.execution.vectorized.WritableColumnVector;
+
+public interface ParquetVectorUpdater {
+  /**
+   * Read a batch of `total` values from `valuesReader` into `values`, 
starting from `offset`.
+   *
+   * @param total total number of values to read
+   * @param offset starting offset in `values`
+   * @param values destination values vector
+   * @param valuesReader reader to read values from
+   */
+  void updateBatch(
+      int total,
+      int offset,
+      WritableColumnVector values,
+      VectorizedValuesReader valuesReader);
+
+  /**
+   * Read a single value from `valuesReader` into `values`, at `offset`.
+   *
+   * @param offset offset in `values` to put the new value
+   * @param values destination value vector
+   * @param valuesReader reader to read values from
+   */
+  void update(int offset, WritableColumnVector values, VectorizedValuesReader 
valuesReader);
+
+  /**
+   * Decode a batch of `total` dictionary IDs from `dictionaryIds` into 
`values` starting at
+   * `offset`, using `dictionary`.

Review comment:
       let's mention the null behavior in the doc: Some slots in `values` can 
be non-null, which means the value is already filled and we don't need to read 
from the dictionary.




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

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



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

Reply via email to