You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2017/11/16 03:52:19 UTC

[GitHub] spark pull request #19601: [SPARK-22383][SQL] Generate code to directly get ...

Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19601#discussion_r151315786
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/UnsafeColumnVector.java ---
    @@ -0,0 +1,517 @@
    +/*
    + * 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.nio.ByteBuffer;
    +
    +import org.apache.commons.lang.NotImplementedException;
    +
    +import org.apache.spark.sql.catalyst.expressions.UnsafeArrayData;
    +import org.apache.spark.sql.types.*;
    +import org.apache.spark.unsafe.Platform;
    +
    +/**
    + * A column backed by UnsafeArrayData on byte[].
    + */
    +public final class UnsafeColumnVector extends WritableColumnVector {
    --- End diff --
    
    This abstraction looks confused at first glance. It seems not following some `ColumnVector` APIs usage. Looks like this uses `putByteArray` to set up byte array `data` which stores the data of this array column.
    
    IIUC, this is proposed to represent only array column, but some APIs implementation looks weird. For example, `getBoolean` respects `rowId` parameter and `getBooleans` doesn't.


---

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