Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16209#discussion_r107091965
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala ---
    @@ -362,4 +363,80 @@ class JDBCWriteSuite extends SharedSQLContext with 
BeforeAndAfter {
           assert(sql("select * from people_view").count() == 2)
         }
       }
    +
    +  test("SPARK-10849: create table using user specified column type.") {
    +    val data = Seq[Row](
    +      Row(1, "dave", "Boston", "electric cars"),
    +      Row(2, "mary", "Seattle", "building planes")
    +    )
    +    val schema = StructType(
    +      StructField("id", IntegerType) ::
    +        StructField("first#name", StringType) ::
    +        StructField("city", StringType) ::
    +        StructField("descr", StringType) ::
    +        Nil)
    +    val df = spark.createDataFrame(sparkContext.parallelize(data), schema)
    +    // Use database specific CHAR/VARCHAR types instead of String data 
type.
    +    val createTableColTypes = "`first#name` VARCHAR(123), city CHAR(20)"
    +    assert(JdbcUtils.schemaString(df.schema, url1, 
Option(createTableColTypes)) ==
    +      s""""id" INTEGER , "first#name" VARCHAR(123) , "city" CHAR(20) , 
"descr" TEXT """)
    --- End diff --
    
    nit: Drop interpolation `s` in the head.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to