Skip to content

Commit

Permalink
[MINOR] [SQL] Minor fix for CatalystSchemaConverter
Browse files Browse the repository at this point in the history
ping liancheng

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #7224 from viirya/few_fix_catalystschema and squashes the following commits:

d994330 [Liang-Chi Hsieh] Minor fix for CatalystSchemaConverter.
  • Loading branch information
viirya authored and liancheng committed Jul 5, 2015
1 parent c991ef5 commit 2b820f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private[spark] object SQLConf {
val PARQUET_FOLLOW_PARQUET_FORMAT_SPEC = booleanConf(
key = "spark.sql.parquet.followParquetFormatSpec",
defaultValue = Some(false),
doc = "Wether to stick to Parquet format specification when converting Parquet schema to " +
doc = "Whether to stick to Parquet format specification when converting Parquet schema to " +
"Spark SQL schema and vice versa. Sticks to the specification if set to true; falls back " +
"to compatible mode if set to false.",
isPublic = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ private[parquet] class CatalystSchemaConverter(
DecimalType(precision, scale)
}

field.getPrimitiveTypeName match {
typeName match {
case BOOLEAN => BooleanType

case FLOAT => FloatType

case DOUBLE => DoubleType

case INT32 =>
field.getOriginalType match {
originalType match {
case INT_8 => ByteType
case INT_16 => ShortType
case INT_32 | null => IntegerType
Expand All @@ -161,7 +161,7 @@ private[parquet] class CatalystSchemaConverter(
}

case INT64 =>
field.getOriginalType match {
originalType match {
case INT_64 | null => LongType
case DECIMAL => makeDecimalType(maxPrecisionForBytes(8))
case TIMESTAMP_MILLIS => typeNotImplemented()
Expand All @@ -176,7 +176,7 @@ private[parquet] class CatalystSchemaConverter(
TimestampType

case BINARY =>
field.getOriginalType match {
originalType match {
case UTF8 | ENUM => StringType
case null if assumeBinaryIsString => StringType
case null => BinaryType
Expand All @@ -185,7 +185,7 @@ private[parquet] class CatalystSchemaConverter(
}

case FIXED_LEN_BYTE_ARRAY =>
field.getOriginalType match {
originalType match {
case DECIMAL => makeDecimalType(maxPrecisionForBytes(field.getTypeLength))
case INTERVAL => typeNotImplemented()
case _ => illegalType()
Expand Down Expand Up @@ -261,7 +261,7 @@ private[parquet] class CatalystSchemaConverter(
// Here we implement Parquet LIST backwards-compatibility rules.
// See: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#backward-compatibility-rules
// scalastyle:on
private def isElementType(repeatedType: Type, parentName: String) = {
private def isElementType(repeatedType: Type, parentName: String): Boolean = {
{
// For legacy 2-level list types with primitive element type, e.g.:
//
Expand Down

0 comments on commit 2b820f2

Please sign in to comment.