From 5936e09d078cb2b34f00da16e6fe8571ab072ee8 Mon Sep 17 00:00:00 2001 From: Jacek Laskowski Date: Wed, 17 Aug 2016 13:26:14 -0700 Subject: [PATCH 1/2] [SPARK-17101][SQL] Provide consistent format identifiers for TextFileFormat and ParquetFileFormat --- .../sql/execution/datasources/parquet/ParquetFileFormat.scala | 2 +- .../spark/sql/execution/datasources/text/TextFileFormat.scala | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala index 9c4778acf53d7..0d5a25ca16e50 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala @@ -60,7 +60,7 @@ class ParquetFileFormat override def shortName(): String = "parquet" - override def toString: String = "ParquetFormat" + override def toString: String = shortName.toUpperCase override def hashCode(): Int = getClass.hashCode() diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala index abb6059f75ba8..9ca0c878d43fb 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala @@ -40,6 +40,8 @@ class TextFileFormat extends TextBasedFileFormat with DataSourceRegister { override def shortName(): String = "text" + override def toString: String = shortName.toUpperCase + private def verifySchema(schema: StructType): Unit = { if (schema.size != 1) { throw new AnalysisException( From e780208aa6361de34983b244cdb0ac4544c1645c Mon Sep 17 00:00:00 2001 From: Jacek Laskowski Date: Fri, 19 Aug 2016 23:35:01 +0200 Subject: [PATCH 2/2] toString capitalized --- .../sql/execution/datasources/parquet/ParquetFileFormat.scala | 2 +- .../spark/sql/execution/datasources/text/TextFileFormat.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala index 0d5a25ca16e50..3b74d9dac5463 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala @@ -60,7 +60,7 @@ class ParquetFileFormat override def shortName(): String = "parquet" - override def toString: String = shortName.toUpperCase + override def toString: String = "Parquet" override def hashCode(): Int = getClass.hashCode() diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala index 9ca0c878d43fb..c7353989f6ccc 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala @@ -40,7 +40,7 @@ class TextFileFormat extends TextBasedFileFormat with DataSourceRegister { override def shortName(): String = "text" - override def toString: String = shortName.toUpperCase + override def toString: String = "Text" private def verifySchema(schema: StructType): Unit = { if (schema.size != 1) {