Skip to content

Commit

Permalink
[SPARK-13870][SQL] Add scalastyle escaping correctly in CVSSuite.scala
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

When initial creating `CVSSuite.scala` in SPARK-12833, there was a typo on `scalastyle:on`: `scalstyle:on`. So, it turns off ScalaStyle checking for the rest of the file mistakenly. So, it can not find a violation on the code of `SPARK-12668` added recently. This issue fixes the existing escaping correctly and adds a new escaping for `SPARK-12668` code like the following.

```scala
   test("test aliases sep and encoding for delimiter and charset") {
+    // scalastyle:off
     val cars = sqlContext
...
       .load(testFile(carsFile8859))
+    // scalastyle:on
```
This will prevent future potential problems, too.

## How was this patch tested?

Pass the Jenkins test.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #11700 from dongjoon-hyun/SPARK-13870.
  • Loading branch information
dongjoon-hyun authored and rxin committed Mar 15, 2016
1 parent 43304b1 commit a51f877
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,21 @@ class CSVSuite extends QueryTest with SharedSQLContext with SQLTestUtils {
|OPTIONS (path "${testFile(carsFile8859)}", header "true",
|charset "iso-8859-1", delimiter "þ")
""".stripMargin.replaceAll("\n", " "))
//scalstyle:on
// scalastyle:on

verifyCars(sqlContext.table("carsTable"), withHeader = true)
}

test("test aliases sep and encoding for delimiter and charset") {
// scalastyle:off
val cars = sqlContext
.read
.format("csv")
.option("header", "true")
.option("encoding", "iso-8859-1")
.option("sep", "þ")
.load(testFile(carsFile8859))
// scalastyle:on

verifyCars(cars, withHeader = true)
}
Expand Down

0 comments on commit a51f877

Please sign in to comment.