You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/15 04:38:06 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #25344: [SPARK-28151][SQL] Mapped ByteType to TinyINT for MsSQLServerDialect

dongjoon-hyun commented on a change in pull request #25344: [SPARK-28151][SQL] Mapped ByteType to TinyINT for MsSQLServerDialect
URL: https://github.com/apache/spark/pull/25344#discussion_r334749450
 
 

 ##########
 File path: external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MsSqlServerIntegrationSuite.scala
 ##########
 @@ -202,4 +204,36 @@ class MsSqlServerIntegrationSuite extends DockerJDBCIntegrationSuite {
     df2.write.jdbc(jdbcUrl, "datescopy", new Properties)
     df3.write.jdbc(jdbcUrl, "stringscopy", new Properties)
   }
+
+  test("SPARK-28151 Test write table with BYTETYPE") {
+    val df : DataFrame = {
+      val schema = StructType(Seq(
+        StructField("a", ByteType, true)
+      ))
+      val data = Seq(
+        Row(-127.toByte),
+        Row(0.toByte),
+        Row(1.toByte),
+        Row(38.toByte),
+        Row(128.toByte)
+      )
+      spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+    }
 
 Review comment:
   ```scala
   -  test("SPARK-28151 Test write table with BYTETYPE") {
   -    val df : DataFrame = {
   -      val schema = StructType(Seq(
   -        StructField("a", ByteType, true)
   -      ))
   -      val data = Seq(
   -        Row(-127.toByte),
   -        Row(0.toByte),
   -        Row(1.toByte),
   -        Row(38.toByte),
   -        Row(128.toByte)
   -      )
   -      spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
   -    }
   +  test("Write table with BYTETYPE") {
   +    import testImplicits._
   +
   +    val df = Seq(-127.toByte, 0.toByte, 1.toByte, 38.toByte, 128.toByte).toDF("a")
   +
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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