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

    https://github.com/apache/spark/pull/5725#discussion_r29218869
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
 ---
    @@ -0,0 +1,428 @@
    +/*
    + * 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.catalyst.expressions;
    +
    +import scala.collection.Map;
    +import scala.collection.Seq;
    +import scala.collection.mutable.ArraySeq;
    +
    +import javax.annotation.Nullable;
    +import java.math.BigDecimal;
    +import java.sql.Date;
    +import java.util.*;
    +
    +import org.apache.spark.sql.Row;
    +import org.apache.spark.sql.types.DataType;
    +import static org.apache.spark.sql.types.DataTypes.*;
    +import org.apache.spark.sql.types.StructType;
    +import org.apache.spark.sql.types.UTF8String;
    +import org.apache.spark.unsafe.PlatformDependent;
    +import org.apache.spark.unsafe.bitset.BitSetMethods;
    +
    +/**
    + * An Unsafe implementation of Row which is backed by raw memory instead 
of Java objects.
    + *
    + * Each tuple has three parts: [null bit set] [values] [variable length 
portion]
    + *
    + * The bit set is used for null tracking and is aligned to 8-byte word 
boundaries.  It stores
    + * one bit per field.
    + *
    + * In the `values` region, we store one 8-byte word per field. For fields 
that hold fixed-length
    + * primitive types, such as long, double, or int, we store the value 
directly in the word. For
    + * fields with non-primitive or variable-length values, we store a 
relative offset (w.r.t. the
    + * base address of the row) that points to the beginning of the 
variable-length field.
    + *
    + * Instances of `UnsafeRow` act as pointers to row data stored in this 
format, similar to how
    + * `Writable` objects work in Hadoop.
    + */
    +public final class UnsafeRow implements MutableRow {
    +
    +  private Object baseObject;
    +  private long baseOffset;
    +  /** The number of fields in this row, used for calculating the bitset 
width (and in assertions) */
    --- End diff --
    
    nitpick: if we have comments, let's add a blank line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to