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

    https://github.com/apache/spark/pull/4187#discussion_r23501411
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetConverter.scala ---
    @@ -426,6 +423,33 @@ private[parquet] class CatalystPrimitiveConverter(
         parent.updateLong(fieldIndex, value)
     }
     
    +/**
    + * A `parquet.io.api.PrimitiveConverter` that converts Parquet Binary to 
Catalyst String.
    + * Supports dictionaries to reduce Binary to String conversion overhead.
    + *
    + * Follows pattern in Parquet of using dictionaries, where supported, for 
String conversion.
    + *
    + * @param parent The parent group converter.
    + * @param fieldIndex The index inside the record.
    + */
    +private[parquet] class CatalystPrimitiveStringConverter(parent: 
CatalystConverter, fieldIndex: Int)
    +  extends CatalystPrimitiveConverter(parent, fieldIndex) {
    +
    +  private var dict: Array[String] = null
    --- End diff --
    
    I once made a pretty naive attempt at converting instances of `private` to 
`private[this]` in Spark.  That doesn't work as simply as you'd like it to, so 
"always use `private[this]`" can't be a hard and fast recommendation.  On the 
other hand, I also know from plenty of experience in another code base that 
defaulting to `private[this]` almost always does what you want it to, so it's a 
pretty painless way to seek a little extra performance if you adopt this code 
style.


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

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

Reply via email to