spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #16386: [SPARK-18352][SQL] Support parsing multiline json...
Date Sat, 11 Feb 2017 00:26:00 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16386#discussion_r100650577
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala
---
    @@ -1764,4 +1769,123 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData
{
         val df2 = spark.read.option("PREfersdecimaL", "true").json(records)
         assert(df2.schema == schema)
       }
    +
    +  test("SPARK-18352: Parse normal multi-line JSON files (compressed)") {
    +    withTempPath { dir =>
    +      val path = dir.getCanonicalPath
    +      primitiveFieldAndType
    +        .toDF("value")
    +        .write
    +        .option("compression", "GzIp")
    +        .text(path)
    +
    +      new File(path).listFiles() match {
    +        case compressedFiles =>
    +          assert(compressedFiles.exists(_.getName.endsWith(".gz")))
    +      }
    +
    +      val jsonDF = spark.read.option("wholeFile", true).json(path)
    +      val jsonDir = new File(dir, "json").getCanonicalPath
    +      jsonDF.coalesce(1).write
    +        .format("json")
    +        .option("compression", "gZiP")
    --- End diff --
    
    we don't support `wholeFile` at write side, right?


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