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/07/03 04:05:11 UTC

[GitHub] [spark] maropu commented on issue #24845: [SPARK-28097][SQL] Map ByteType to SMALLINT when using JDBC with PostgreSQL

maropu commented on issue #24845: [SPARK-28097][SQL] Map ByteType to SMALLINT when using JDBC with PostgreSQL
URL: https://github.com/apache/spark/pull/24845#issuecomment-507929409
 
 
   `PostgresIntegrationSuite` can run `(DF → JDBC)` tests easily like this;
   ```
     test("write byte as smallint") {
       sqlContext.createDataFrame(Seq((1.toByte, 2.toShort)))
         .write.jdbc(jdbcUrl, "byte_to_smallint_test", new Properties)
       val df = sqlContext.read.jdbc(jdbcUrl, "byte_to_smallint_test", new Properties)
       val schema = df.schema
       assert(schema(0).dataType == ShortType)
       assert(schema(1).dataType == ShortType)
       val rows = df.collect()
       assert(rows.length === 1)
       assert(rows(0).getShort(0) === 1)
       assert(rows(0).getShort(1) === 2)
     }
   ```

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