Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16891#discussion_r100867361
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala 
---
    @@ -925,4 +925,53 @@ class JDBCSuite extends SparkFunSuite
         assert(res.generatedRows.isEmpty)
         assert(res.outputRows === foobarCnt :: Nil)
       }
    +
    +  test("SPARK-19318: Connection properties keys should be 
case-sensitivie.") {
    --- End diff --
    
    can you simply this test a bit? e.g.
    ```
    val parameters = Map("dbTAblE" -> "t1", "cutomKey" -> "a-value")
    def testJdbcOption(option: JDBCOption): Unit = {
      // Spark JDBC data source options are case-insensitive
      assert(options.table == "t1")
      // When we convert it to properties, it should be case-sensitive.
      assert(options.asProperties.get("customkey") == null)
      assert(options.asProperties.get("customKey") == "a-value")
      assert(options.asConnectionProperties.get("customkey") == null)
      assert(options.asConnectionProperties.get("customKey") == "a-value")
    }
    
    val parameters = Map("dbTAblE" -> "t1", "cutomKey" -> "a-value")
    testJdbcOption(new JDBCOption(parameters))
    testJdbcOption(new JDBCOption(new CaseInsensitiveMap(parameters)))
    test add/remove key-value from the case-insensitive map ...
    ```



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to