From 704f86fce8542e3e89700b76dd7be6b0e3e7fc0c Mon Sep 17 00:00:00 2001 From: sfc-gh-astachowski Date: Tue, 5 Nov 2024 05:58:35 +0100 Subject: [PATCH] Fixed assertions of array equality --- .../client/jdbc/ResultSetVectorLatestIT.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/java/net/snowflake/client/jdbc/ResultSetVectorLatestIT.java b/src/test/java/net/snowflake/client/jdbc/ResultSetVectorLatestIT.java index 7114b1ffe..8393659b7 100644 --- a/src/test/java/net/snowflake/client/jdbc/ResultSetVectorLatestIT.java +++ b/src/test/java/net/snowflake/client/jdbc/ResultSetVectorLatestIT.java @@ -1,6 +1,7 @@ package net.snowflake.client.jdbc; import static net.snowflake.client.jdbc.SnowflakeUtil.EXTRA_TYPES_VECTOR; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -39,7 +40,7 @@ public void testGetIntVectorAsIntArray(String queryResultFormat) throws SQLExcep assertTrue(resultSet.next()); Integer[] result = resultSet.unwrap(SnowflakeBaseResultSet.class).getArray(1, Integer.class); - assertEquals(vector, result); + assertArrayEquals(vector, result); assertVectorMetadata(resultSet, 1, Types.INTEGER, 1); } } @@ -54,7 +55,7 @@ public void testGetIntVectorAsLongArray(String queryResultFormat) throws SQLExce try (ResultSet resultSet = stmt.executeQuery("select " + vectorToString(vector, "int"))) { assertTrue(resultSet.next()); Long[] result = resultSet.unwrap(SnowflakeBaseResultSet.class).getArray(1, Long.class); - assertEquals(vector, result); + assertArrayEquals(vector, result); assertVectorMetadata(resultSet, 1, Types.INTEGER, 1); } } @@ -69,7 +70,7 @@ public void testGetFloatVectorAsFloatArray(String queryResultFormat) throws SQLE try (ResultSet resultSet = stmt.executeQuery("select " + vectorToString(vector, "float"))) { assertTrue(resultSet.next()); Float[] result = resultSet.unwrap(SnowflakeBaseResultSet.class).getArray(1, Float.class); - assertEquals(vector, result); + assertArrayEquals(vector, result); assertVectorMetadata(resultSet, 1, Types.FLOAT, 1); } } @@ -116,7 +117,7 @@ public void testGetIntVectorFromTable(String queryResultFormat) throws SQLExcept assertTrue(resultSet.next()); Integer[] result = resultSet.unwrap(SnowflakeBaseResultSet.class).getArray(1, Integer.class); - assertEquals(new Integer[] {3, 7}, result); + assertArrayEquals(new Integer[] {3, 7}, result); assertVectorMetadata(resultSet, 1, Types.INTEGER, 2); } } @@ -132,7 +133,7 @@ public void testGetFloatVectorFromTable(String queryResultFormat) throws SQLExce try (ResultSet resultSet = stmt.executeQuery("select x, y from test_vector_float")) { assertTrue(resultSet.next()); Float[] result = resultSet.unwrap(SnowflakeBaseResultSet.class).getArray(1, Float.class); - assertEquals(new Float[] {-3f, 7.1f}, result); + assertArrayEquals(new Float[] {-3f, 7.1f}, result); assertVectorMetadata(resultSet, 1, Types.FLOAT, 2); } }