You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by MaxGekk <gi...@git.apache.org> on 2018/11/06 20:28:02 UTC

[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

GitHub user MaxGekk opened a pull request:

    https://github.com/apache/spark/pull/22960

    [SPARK-25955][TEST] Porting JSON tests for CSV functions

    ## What changes were proposed in this pull request?
    
    In the PR, I propose to port existing JSON tests from `JsonFunctionsSuite` that are applicable for CSV, and put them to `CsvFunctionsSuite`. In particular:
    - roundtrip `from_csv` to `to_csv`, and `to_csv` to `from_csv`
    - using `schema_of_csv` in `from_csv`
    - Java API `from_csv`
    - using `from_csv` and `to_csv` in exprs.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MaxGekk/spark-1 csv-additional-tests

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/22960.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22960
    
----
commit 345f2a6b0d480a6e24a398380a49792366fa8c6e
Author: Maxim Gekk <ma...@...>
Date:   2018-11-06T19:36:34Z

    Tests - roundtrip from_csv <-> to_csv

commit 606be67e8a422a0e650c2dc29bd724be9b80e411
Author: Maxim Gekk <ma...@...>
Date:   2018-11-06T20:07:44Z

    SQL + java tests

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98566 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98566/testReport)** for PR 22960 at commit [`24933a9`](https://github.com/apache/spark/commit/24933a9e457fe6b0110de0aa27bc9eaa9dc00fb9).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98542 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98542/testReport)** for PR 22960 at commit [`1d3a31b`](https://github.com/apache/spark/commit/1d3a31b478622a8e76dfeef0f71973aa71730859).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98566/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98530/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/22960


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98566 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98566/testReport)** for PR 22960 at commit [`24933a9`](https://github.com/apache/spark/commit/24933a9e457fe6b0110de0aa27bc9eaa9dc00fb9).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22960#discussion_r231344120
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala ---
    @@ -86,4 +86,82 @@ class CsvFunctionsSuite extends QueryTest with SharedSQLContext {
     
         checkAnswer(df.select(to_csv($"a", options)), Row("26/08/2015 18:00") :: Nil)
       }
    +
    +  test("from_csv uses DDL strings for defining a schema - java") {
    +    val df = Seq("""1,"haa"""").toDS()
    +    checkAnswer(
    +      df.select(
    +        from_csv($"value", lit("a INT, b STRING"), new java.util.HashMap[String, String]())),
    +      Row(Row(1, "haa")) :: Nil)
    +  }
    +
    +  test("roundtrip to_csv -> from_csv") {
    +    val df = Seq(Tuple1(Tuple1(1)), Tuple1(null)).toDF("struct")
    +    val schema = df.schema(0).dataType.asInstanceOf[StructType]
    +    val options = Map.empty[String, String]
    +    val readback = df.select(to_csv($"struct").as("csv"))
    +      .select(from_csv($"csv", schema, options).as("struct"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("roundtrip from_csv -> to_csv") {
    +    val df = Seq(Some("1"), None).toDF("csv")
    +    val schema = new StructType().add("a", IntegerType)
    +    val options = Map.empty[String, String]
    +    val readback = df.select(from_csv($"csv", schema, options).as("struct"))
    +      .select(to_csv($"struct").as("csv"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("infers schemas of a CSV string and pass to to from_csv") {
    +    val in = Seq("""0.123456789,987654321,"San Francisco"""").toDS()
    +    val options = Map.empty[String, String].asJava
    +    val out = in.select(from_csv('value, schema_of_csv("0.1,1,a"), options) as "parsed")
    +    val expected = StructType(Seq(StructField(
    +      "parsed",
    +      StructType(Seq(
    +        StructField("_c0", DoubleType, true),
    +        StructField("_c1", IntegerType, true),
    +        StructField("_c2", StringType, true))))))
    +
    +    assert(out.schema == expected)
    +  }
    +
    +  test("Support to_csv in SQL") {
    --- End diff --
    
    @MaxGekk, wouldn't the tests in `csv-functions.sql` be enough for SQL support test?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98542/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by MaxGekk <gi...@git.apache.org>.
Github user MaxGekk commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    > Sorry, but Porting seems to be not the best way to do this.
    
    I saw a bunch of common code in `Csv`/`JsonExpressionsSuite`, `Csv`/`JsonFunctionsSuite` and `Csv`/`JsonSuite`. I just didn't want to overcomplicate the tests especially in the case when there are small differences. So, passing functions (with inputs and expected result) to template functions will not make them easy to read. 
    
    > Could you refactor this by introducing new test helper functions?
    
    In any case, I will try that.



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98530 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98530/testReport)** for PR 22960 at commit [`606be67`](https://github.com/apache/spark/commit/606be67e8a422a0e650c2dc29bd724be9b80e411).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98531/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22960#discussion_r231413853
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala ---
    @@ -86,4 +86,82 @@ class CsvFunctionsSuite extends QueryTest with SharedSQLContext {
     
         checkAnswer(df.select(to_csv($"a", options)), Row("26/08/2015 18:00") :: Nil)
       }
    +
    +  test("from_csv uses DDL strings for defining a schema - java") {
    +    val df = Seq("""1,"haa"""").toDS()
    +    checkAnswer(
    +      df.select(
    +        from_csv($"value", lit("a INT, b STRING"), new java.util.HashMap[String, String]())),
    +      Row(Row(1, "haa")) :: Nil)
    +  }
    +
    +  test("roundtrip to_csv -> from_csv") {
    +    val df = Seq(Tuple1(Tuple1(1)), Tuple1(null)).toDF("struct")
    +    val schema = df.schema(0).dataType.asInstanceOf[StructType]
    +    val options = Map.empty[String, String]
    +    val readback = df.select(to_csv($"struct").as("csv"))
    +      .select(from_csv($"csv", schema, options).as("struct"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("roundtrip from_csv -> to_csv") {
    +    val df = Seq(Some("1"), None).toDF("csv")
    +    val schema = new StructType().add("a", IntegerType)
    +    val options = Map.empty[String, String]
    +    val readback = df.select(from_csv($"csv", schema, options).as("struct"))
    +      .select(to_csv($"struct").as("csv"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("infers schemas of a CSV string and pass to to from_csv") {
    +    val in = Seq("""0.123456789,987654321,"San Francisco"""").toDS()
    +    val options = Map.empty[String, String].asJava
    +    val out = in.select(from_csv('value, schema_of_csv("0.1,1,a"), options) as "parsed")
    +    val expected = StructType(Seq(StructField(
    +      "parsed",
    +      StructType(Seq(
    +        StructField("_c0", DoubleType, true),
    +        StructField("_c1", IntegerType, true),
    +        StructField("_c2", StringType, true))))))
    +
    +    assert(out.schema == expected)
    +  }
    +
    +  test("Support to_csv in SQL") {
    --- End diff --
    
    I think we can just get rid of it. I can't imagine both functions are specifically broken alone in `selectExpr`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98531 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98531/testReport)** for PR 22960 at commit [`d863402`](https://github.com/apache/spark/commit/d863402db4ef0165c7a1b9da1eb6a4151d162741).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

Posted by MaxGekk <gi...@git.apache.org>.
Github user MaxGekk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22960#discussion_r231399775
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala ---
    @@ -86,4 +86,82 @@ class CsvFunctionsSuite extends QueryTest with SharedSQLContext {
     
         checkAnswer(df.select(to_csv($"a", options)), Row("26/08/2015 18:00") :: Nil)
       }
    +
    +  test("from_csv uses DDL strings for defining a schema - java") {
    +    val df = Seq("""1,"haa"""").toDS()
    +    checkAnswer(
    +      df.select(
    +        from_csv($"value", lit("a INT, b STRING"), new java.util.HashMap[String, String]())),
    +      Row(Row(1, "haa")) :: Nil)
    +  }
    +
    +  test("roundtrip to_csv -> from_csv") {
    +    val df = Seq(Tuple1(Tuple1(1)), Tuple1(null)).toDF("struct")
    +    val schema = df.schema(0).dataType.asInstanceOf[StructType]
    +    val options = Map.empty[String, String]
    +    val readback = df.select(to_csv($"struct").as("csv"))
    +      .select(from_csv($"csv", schema, options).as("struct"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("roundtrip from_csv -> to_csv") {
    +    val df = Seq(Some("1"), None).toDF("csv")
    +    val schema = new StructType().add("a", IntegerType)
    +    val options = Map.empty[String, String]
    +    val readback = df.select(from_csv($"csv", schema, options).as("struct"))
    +      .select(to_csv($"struct").as("csv"))
    +
    +    checkAnswer(df, readback)
    +  }
    +
    +  test("infers schemas of a CSV string and pass to to from_csv") {
    +    val in = Seq("""0.123456789,987654321,"San Francisco"""").toDS()
    +    val options = Map.empty[String, String].asJava
    +    val out = in.select(from_csv('value, schema_of_csv("0.1,1,a"), options) as "parsed")
    +    val expected = StructType(Seq(StructField(
    +      "parsed",
    +      StructType(Seq(
    +        StructField("_c0", DoubleType, true),
    +        StructField("_c1", IntegerType, true),
    +        StructField("_c2", StringType, true))))))
    +
    +    assert(out.schema == expected)
    +  }
    +
    +  test("Support to_csv in SQL") {
    --- End diff --
    
    This is only for double check that the functions are available/(and work) from expressions in Scala. Probably we can make the test smaller.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98542 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98542/testReport)** for PR 22960 at commit [`1d3a31b`](https://github.com/apache/spark/commit/1d3a31b478622a8e76dfeef0f71973aa71730859).
     * This patch **fails due to an unknown error code, -9**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98530 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98530/testReport)** for PR 22960 at commit [`606be67`](https://github.com/apache/spark/commit/606be67e8a422a0e650c2dc29bd724be9b80e411).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Ur, maybe, I'm not clear to the point. The refactoring scope of this PR is limited to the new tests here.
    ```
    test("from_csv uses DDL strings for defining a schema - java")
    test("roundtrip to_csv -> from_csv")
    test("roundtrip from_csv -> to_csv")
    test("infers schemas of a CSV string and pass to to from_csv")
    test("Support to_csv in SQL")
    test("Support from_csv in SQL")
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Merged to master.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    **[Test build #98531 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98531/testReport)** for PR 22960 at commit [`d863402`](https://github.com/apache/spark/commit/d863402db4ef0165c7a1b9da1eb6a4151d162741).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22960: [SPARK-25955][TEST] Porting JSON tests for CSV fu...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22960#discussion_r231380992
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala ---
    @@ -86,4 +86,82 @@ class CsvFunctionsSuite extends QueryTest with SharedSQLContext {
     
         checkAnswer(df.select(to_csv($"a", options)), Row("26/08/2015 18:00") :: Nil)
       }
    +
    +  test("from_csv uses DDL strings for defining a schema - java") {
    +    val df = Seq("""1,"haa"""").toDS()
    +    checkAnswer(
    +      df.select(
    +        from_csv($"value", lit("a INT, b STRING"), new java.util.HashMap[String, String]())),
    --- End diff --
    
    The only difference is `from_csv` and `from_json`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22960: [SPARK-25955][TEST] Porting JSON tests for CSV functions

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/22960
  
    Yes. It would be great if we do that in this PR.
    
    When I did the similar thing for ORC (`port tests from Parquet to ORC`, `port from old ORC to new ORC`). I received the same comments.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org