PetarVasiljevic-DB commented on code in PR #48625:
URL: https://github.com/apache/spark/pull/48625#discussion_r1815301416


##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/PostgresIntegrationSuite.scala:
##########
@@ -125,43 +126,58 @@ class PostgresIntegrationSuite extends 
DockerJDBCIntegrationV2Suite with V2JDBCT
     connection.prepareStatement(
     "CREATE TABLE datetime (name VARCHAR(32), date1 DATE, time1 TIMESTAMP)")
     .executeUpdate()
+
+    connection.prepareStatement("CREATE TABLE array_of_array_of_int (col 
int[][])")
+      .executeUpdate()
+    connection.prepareStatement("INSERT INTO array_of_array_of_int " +
+      "VALUES (array[array[1],array[2]])").executeUpdate()
+    connection.prepareStatement("CREATE TABLE ctas_array_of_array_of_int " +
+      "AS SELECT * FROM array_of_array_of_int").executeUpdate()
+
+    connection.prepareStatement("CREATE TABLE 
unsupported_array_of_array_of_int (col int[][])")
+      .executeUpdate()
+    connection.prepareStatement("INSERT INTO unsupported_array_of_array_of_int 
" +
+      "VALUES (array[array[1],array[2]]), (array[3])").executeUpdate()
   }
 
   test("Test multi-dimensional column types") {
-    // This test is used to verify that the multi-dimensional
-    // column types are supported by the JDBC V2 data source.
-    // We do not verify any result output
-    //
-    val df = spark.read.format("jdbc")
-      .option("url", jdbcUrl)
-      .option("dbtable", "array_test_table")
-      .load()
-    df.collect()
-
-    val array_tables = Array(
-      ("array_int", "\"ARRAY<INT>\""),
-      ("array_bigint", "\"ARRAY<BIGINT>\""),
-      ("array_smallint", "\"ARRAY<SMALLINT>\""),
-      ("array_boolean", "\"ARRAY<BOOLEAN>\""),
-      ("array_float", "\"ARRAY<FLOAT>\""),
-      ("array_double", "\"ARRAY<DOUBLE>\""),
-      ("array_timestamp", "\"ARRAY<TIMESTAMP>\""),
-      ("array_timestamptz", "\"ARRAY<TIMESTAMP>\"")
-    )
+    
withSQLConf(SQLConf.POSTGRES_GET_ARRAY_DIM_FROM_PG_ATTRIBUTE_METADATA_TABLE.key 
-> "true") {

Review Comment:
   Have to change the config here because it wouldn't crash with new code since 
arrays will be read as 2D and not as 1D as it in old path.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to