Skip to content

Commit 1216d9a

Browse files
committed
fix ci tests
1 parent e1cba71 commit 1216d9a

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ResultSetTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -806,19 +806,19 @@ public void testResultSetAppMetadata() throws Exception {
806806
public void testSelectQueryWithUuidColumn() throws SQLException {
807807
// Expectations
808808
final int expectedRowCount = 4;
809-
final UUID[] expectedUuids = new UUID[] {
810-
CoreMockedSqlProducers.UUID_1,
811-
CoreMockedSqlProducers.UUID_2,
812-
CoreMockedSqlProducers.UUID_3,
813-
null
814-
};
809+
final UUID[] expectedUuids =
810+
new UUID[] {
811+
CoreMockedSqlProducers.UUID_1,
812+
CoreMockedSqlProducers.UUID_2,
813+
CoreMockedSqlProducers.UUID_3,
814+
null
815+
};
815816

816817
final Integer[] expectedIds = new Integer[] {1, 2, 3, 4};
817818

818819
final List<UUID> actualUuids = new ArrayList<>(expectedRowCount);
819820
final List<Integer> actualIds = new ArrayList<>(expectedRowCount);
820821

821-
822822
// Query
823823
int actualRowCount = 0;
824824
try (Statement statement = connection.createStatement();
@@ -951,7 +951,8 @@ public void testPreparedStatementWithUuidParameter() throws SQLException {
951951

952952
@Test
953953
public void testPreparedStatementWithUuidStringParameter() throws SQLException {
954-
try (PreparedStatement pstmt = connection.prepareStatement(CoreMockedSqlProducers.UUID_PREPARED_SELECT_SQL_CMD)) {
954+
try (PreparedStatement pstmt =
955+
connection.prepareStatement(CoreMockedSqlProducers.UUID_PREPARED_SELECT_SQL_CMD)) {
955956
pstmt.setString(1, CoreMockedSqlProducers.UUID_1.toString());
956957
try (ResultSet rs = pstmt.executeQuery()) {
957958
rs.next();
@@ -962,7 +963,8 @@ public void testPreparedStatementWithUuidStringParameter() throws SQLException {
962963

963964
@Test
964965
public void testPreparedStatementUpdateWithUuid() throws SQLException {
965-
try (PreparedStatement pstmt = connection.prepareStatement(CoreMockedSqlProducers.UUID_PREPARED_UPDATE_SQL_CMD)) {
966+
try (PreparedStatement pstmt =
967+
connection.prepareStatement(CoreMockedSqlProducers.UUID_PREPARED_UPDATE_SQL_CMD)) {
966968
pstmt.setObject(1, CoreMockedSqlProducers.UUID_3);
967969
pstmt.setInt(2, 1);
968970
int updated = pstmt.executeUpdate();

flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/utils/CoreMockedSqlProducers.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.apache.arrow.driver.jdbc.utils;
1818

1919
import static java.lang.String.format;
20-
import java.util.Arrays;
2120
import static org.hamcrest.CoreMatchers.equalTo;
2221
import static org.hamcrest.CoreMatchers.is;
2322
import static org.hamcrest.MatcherAssert.assertThat;
@@ -29,6 +28,7 @@
2928
import java.sql.SQLException;
3029
import java.sql.Timestamp;
3130
import java.util.ArrayList;
31+
import java.util.Arrays;
3232
import java.util.Collections;
3333
import java.util.List;
3434
import java.util.UUID;
@@ -69,8 +69,10 @@ public final class CoreMockedSqlProducers {
6969
public static final String LEGACY_REGULAR_WITH_EMPTY_SQL_CMD = "SELECT * FROM TEST_EMPTIES";
7070

7171
public static final String UUID_SQL_CMD = "SELECT * FROM UUID_TABLE";
72-
public static final String UUID_PREPARED_SELECT_SQL_CMD = "SELECT * FROM UUID_TABLE WHERE uuid_col = ?";
73-
public static final String UUID_PREPARED_UPDATE_SQL_CMD = "UPDATE UUID_TABLE SET uuid_col = ? WHERE id = ?";
72+
public static final String UUID_PREPARED_SELECT_SQL_CMD =
73+
"SELECT * FROM UUID_TABLE WHERE uuid_col = ?";
74+
public static final String UUID_PREPARED_UPDATE_SQL_CMD =
75+
"UPDATE UUID_TABLE SET uuid_col = ? WHERE id = ?";
7476

7577
public static final UUID UUID_1 = UUID.fromString("550e8400-e29b-41d4-a716-446655440000");
7678
public static final UUID UUID_2 = UUID.fromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
@@ -114,6 +116,7 @@ public static MockFlightSqlProducer getUuidProducer() {
114116
addUuidSqlCmdSupport(producer);
115117
return producer;
116118
}
119+
117120
private static void addUuidPreparedUpdateSqlCmdSupport(final MockFlightSqlProducer producer) {
118121
final String query = "UPDATE UUID_TABLE SET uuid_col = ? WHERE id = ?";
119122
final Schema parameterSchema =

flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/utils/SqlTypesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void testGetSqlTypeIdFromArrowType() {
8787

8888
assertEquals(Types.NULL, getSqlTypeIdFromArrowType(new ArrowType.Null()));
8989

90-
assertEquals(Types.OTHER, getSqlTypeIdFromArrowType(new UuidType()));
90+
assertEquals(Types.OTHER, getSqlTypeIdFromArrowType(UuidType.INSTANCE));
9191
}
9292

9393
@Test
@@ -144,6 +144,6 @@ public void testGetSqlTypeNameFromArrowType() {
144144

145145
assertEquals("NULL", getSqlTypeNameFromArrowType(new ArrowType.Null()));
146146

147-
assertEquals("OTHER", getSqlTypeNameFromArrowType(new UuidType()));
147+
assertEquals("OTHER", getSqlTypeNameFromArrowType(UuidType.INSTANCE));
148148
}
149149
}

0 commit comments

Comments
 (0)