spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marmbrus <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7961][SQL]Refactor SQLConf to display b...
Date Fri, 12 Jun 2015 02:47:50 GMT
Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6747#discussion_r32287228
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala ---
    @@ -219,74 +422,78 @@ private[sql] class SQLConf extends Serializable with CatalystConf
{
        * in joins.
        */
       private[spark] def defaultSizeInBytes: Long =
    -    getConf(DEFAULT_SIZE_IN_BYTES, (autoBroadcastJoinThreshold + 1).toString).toLong
    +    getConf(DEFAULT_SIZE_IN_BYTES, autoBroadcastJoinThreshold + 1L)
     
       /**
        * When set to true, we always treat byte arrays in Parquet files as strings.
        */
    -  private[spark] def isParquetBinaryAsString: Boolean =
    -    getConf(PARQUET_BINARY_AS_STRING, "false").toBoolean
    +  private[spark] def isParquetBinaryAsString: Boolean = getConf(PARQUET_BINARY_AS_STRING)
     
       /**
        * When set to true, we always treat INT96Values in Parquet files as timestamp.
        */
    -  private[spark] def isParquetINT96AsTimestamp: Boolean =
    -    getConf(PARQUET_INT96_AS_TIMESTAMP, "true").toBoolean
    +  private[spark] def isParquetINT96AsTimestamp: Boolean = getConf(PARQUET_INT96_AS_TIMESTAMP)
     
       /**
        * When set to true, partition pruning for in-memory columnar tables is enabled.
        */
    -  private[spark] def inMemoryPartitionPruning: Boolean =
    -    getConf(IN_MEMORY_PARTITION_PRUNING, "false").toBoolean
    +  private[spark] def inMemoryPartitionPruning: Boolean = getConf(IN_MEMORY_PARTITION_PRUNING)
     
    -  private[spark] def columnNameOfCorruptRecord: String =
    -    getConf(COLUMN_NAME_OF_CORRUPT_RECORD, "_corrupt_record")
    +  private[spark] def columnNameOfCorruptRecord: String = getConf(COLUMN_NAME_OF_CORRUPT_RECORD)
     
       /**
        * Timeout in seconds for the broadcast wait time in hash join
        */
    -  private[spark] def broadcastTimeout: Int =
    -    getConf(BROADCAST_TIMEOUT, (5 * 60).toString).toInt
    +  private[spark] def broadcastTimeout: Int = getConf(BROADCAST_TIMEOUT)
     
    -  private[spark] def defaultDataSourceName: String =
    -    getConf(DEFAULT_DATA_SOURCE_NAME, "org.apache.spark.sql.parquet")
    +  private[spark] def defaultDataSourceName: String = getConf(DEFAULT_DATA_SOURCE_NAME)
     
    -  private[spark] def partitionDiscoveryEnabled() =
    -    getConf(SQLConf.PARTITION_DISCOVERY_ENABLED, "true").toBoolean
    +  private[spark] def partitionDiscoveryEnabled(): Boolean =
    +    getConf(SQLConf.PARTITION_DISCOVERY_ENABLED)
     
    -  private[spark] def partitionColumnTypeInferenceEnabled() =
    -    getConf(SQLConf.PARTITION_COLUMN_TYPE_INFERENCE, "true").toBoolean
    +  private[spark] def partitionColumnTypeInferenceEnabled(): Boolean =
    +    getConf(SQLConf.PARTITION_COLUMN_TYPE_INFERENCE)
     
       // Do not use a value larger than 4000 as the default value of this property.
       // See the comments of SCHEMA_STRING_LENGTH_THRESHOLD above for more information.
    -  private[spark] def schemaStringLengthThreshold: Int =
    -    getConf(SCHEMA_STRING_LENGTH_THRESHOLD, "4000").toInt
    +  private[spark] def schemaStringLengthThreshold: Int = getConf(SCHEMA_STRING_LENGTH_THRESHOLD)
     
    -  private[spark] def dataFrameEagerAnalysis: Boolean =
    -    getConf(DATAFRAME_EAGER_ANALYSIS, "true").toBoolean
    +  private[spark] def dataFrameEagerAnalysis: Boolean = getConf(DATAFRAME_EAGER_ANALYSIS)
     
       private[spark] def dataFrameSelfJoinAutoResolveAmbiguity: Boolean =
    -    getConf(DATAFRAME_SELF_JOIN_AUTO_RESOLVE_AMBIGUITY, "true").toBoolean
    +    getConf(DATAFRAME_SELF_JOIN_AUTO_RESOLVE_AMBIGUITY)
     
    -  private[spark] def dataFrameRetainGroupColumns: Boolean =
    -    getConf(DATAFRAME_RETAIN_GROUP_COLUMNS, "true").toBoolean
    +  private[spark] def dataFrameRetainGroupColumns: Boolean = getConf(DATAFRAME_RETAIN_GROUP_COLUMNS)
     
       /** ********************** SQLConf functionality methods ************ */
     
       /** Set Spark SQL configuration properties. */
       def setConf(props: Properties): Unit = settings.synchronized {
    -    props.foreach { case (k, v) => settings.put(k, v) }
    +    props.foreach { case (k, v) => setRawConf(k, v) }
       }
     
    -  /** Set the given Spark SQL configuration property. */
    -  def setConf(key: String, value: String): Unit = {
    +  /** Set the given Spark SQL configuration property using a `string` value. */
    +  def setRawConf(key: String, value: String): Unit = {
    --- End diff --
    
    Why `Raw`? Maybe, `setConfString`?


---
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