You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/27 07:49:52 UTC

[GitHub] [spark] xuechendi commented on a change in pull request #34396: [SPARK-37124][SQL] Add ArrowWritableColumnVector

xuechendi commented on a change in pull request #34396:
URL: https://github.com/apache/spark/pull/34396#discussion_r737197861



##########
File path: sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ArrowWritableColumnVector.java
##########
@@ -0,0 +1,1322 @@
+/*
+ * 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.vectorized;
+
+import java.lang.*;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicLong;
+
+import com.google.common.annotations.VisibleForTesting;
+
+import org.apache.spark.sql.vectorized.ArrowColumnVector;
+
+import org.apache.arrow.memory.BufferAllocator;
+import org.apache.arrow.vector.*;
+import org.apache.arrow.vector.complex.*;
+import org.apache.arrow.vector.holders.NullableVarCharHolder;
+import org.apache.arrow.vector.ipc.message.ArrowRecordBatch;
+import org.apache.arrow.vector.types.pojo.Schema;
+import org.apache.arrow.vector.types.pojo.Field;
+
+import org.apache.spark.sql.catalyst.util.DateTimeUtils;
+import org.apache.spark.sql.execution.vectorized.WritableColumnVector;
+import org.apache.spark.sql.internal.SQLConf;
+import org.apache.spark.sql.util.ArrowUtils;
+import org.apache.spark.sql.vectorized.*;
+import org.apache.spark.sql.types.*;
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.types.UTF8String;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A column backed by an in memory JVM array. This stores the NULLs as a byte
+ * per value and a java array for the values.
+ */
+public final class ArrowWritableColumnVector extends WritableColumnVector {

Review comment:
       @cloud-fan , thanks for reviewing
   yes, <code>ArrowWritableColumnVector</code> is wrapping <code>ArrowColumnVector</code> and then add all put APIs.
   The reason I want to do so is by doing this, <code>ArrowWritableColumnVector</code> can be the third ColumnVector option, and operators which now support ColumnVector such as RowToArrowColumnarExec /  InMemoryStore / ArrowUDF can use arrow as its memory layout format.(Codes are ready in our repo)
   Also, we are also thinking to add arrow datasource as another spark read format to load parquet/orc can directly as Arrow format ColumnVectors in future.
   So for this PR, I am thinking to propose this idea and see if this makes sense to you guys.




-- 
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: reviews-unsubscribe@spark.apache.org

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



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