panbingkun commented on code in PR #46655: URL: https://github.com/apache/spark/pull/46655#discussion_r1610842180
########## connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MySQLIntegrationSuite.scala: ########## @@ -154,30 +154,43 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite { test("SPARK-47462: Unsigned numeric types") { val df = sqlContext.read.jdbc(jdbcUrl, "unsigned_numbers", new Properties) val rows = df.head() - assert(rows.get(0).isInstanceOf[Short]) - assert(rows.get(1).isInstanceOf[Integer]) - assert(rows.get(2).isInstanceOf[Integer]) - assert(rows.get(3).isInstanceOf[Long]) - assert(rows.get(4).isInstanceOf[BigDecimal]) - assert(rows.get(5).isInstanceOf[BigDecimal]) - assert(rows.get(6).isInstanceOf[Double]) - // Unlike MySQL, MariaDB seems not to distinguish signed and unsigned tinyint(1). val isMaria = jdbcUrl.indexOf("disableMariaDbDriver") == -1 if (isMaria) { + assert(rows.get(0).isInstanceOf[Integer]) + assert(rows.get(1).isInstanceOf[Long]) + assert(rows.get(2).isInstanceOf[Integer]) + assert(rows.get(3).isInstanceOf[BigDecimal]) Review Comment: the root cause of this change - change: index[0], Short => Integer index[1], Integer => Long index[3], Long => Decimal - Before - (mariadb jdbc driver: 2.7.12): <img width="1037" alt="image" src="https://github.com/apache/spark/assets/15246973/58a86548-718b-4115-8b4b-7a6dce2bbfcc"> - After - (mariadb jdbc driver: 3.4.0): <img width="1240" alt="image" src="https://github.com/apache/spark/assets/15246973/6d14d445-8985-48cf-96a9-dcd13b9a945b"> - Summary the data types obtained from the `underlying meta` are different -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org