spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davies <...@git.apache.org>
Subject [GitHub] spark pull request: [Spark-14138][SQL] Fix generated SpecificColum...
Date Mon, 28 Mar 2016 20:06:16 GMT
Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11984#discussion_r57624829
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/GenerateColumnAccessor.scala
---
    @@ -114,6 +123,57 @@ object GenerateColumnAccessor extends CodeGenerator[Seq[DataType],
ColumnarItera
           (createCode, extract + patch)
         }.unzip
     
    +    val accessorCode = accessorClasses.map { case (accessorCls, shortAccCls) =>
    +      s"""
    +         private $accessorCls get${shortAccCls}(int idx) {
    +           byte[] buffer = batch.buffers()[columnIndexes[idx]];
    +           return new $accessorCls(ByteBuffer.wrap(buffer).order(nativeOrder));
    +         }
    +      """
    +    }
    +    val accessorStructCode = accessorStructClasses.map {
    +      case ((accessorCls, dtCls), (shortAccCls, shortDTCls)) =>
    +        s"""
    +           private $accessorCls get${shortAccCls}_${shortDTCls}(int idx) {
    +             byte[] buffer = batch.buffers()[columnIndexes[idx]];
    +             return new $accessorCls(ByteBuffer.wrap(buffer).order(nativeOrder),
    +               (${dtCls}) columnTypes[idx]);
    +           }
    +        """
    +    }
    +
    +    /* 4000 = 64000 bytes / 16 (up to 16 bytes per one call)) */
    +    val numberOfStatementsThreshold = 4000
    --- End diff --
    
    A java method will not be JITted if it's over 8K, so we may need smaller threshold here.
Could you also manual check that (for performance)?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message