Skip to content

Commit 5b170e5

Browse files
committed
chore: clean up based on pr comments
1 parent 6229229 commit 5b170e5

2 files changed

Lines changed: 12 additions & 31 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -912,20 +912,11 @@ private void processArrowStream(
912912
enqueueError(arrowBatchWrapperBlockingQueue, e);
913913
Thread.currentThread().interrupt();
914914
} catch (Exception e) {
915-
if (e.getCause() instanceof InterruptedException || Thread.currentThread().isInterrupted()) {
916-
LOG.log(
917-
Level.WARNING,
918-
"\n" + Thread.currentThread().getName() + " Interrupted @ arrowStreamProcessor",
919-
e);
920-
enqueueError(arrowBatchWrapperBlockingQueue, e);
921-
Thread.currentThread().interrupt();
922-
} else {
923-
LOG.log(
924-
Level.WARNING,
925-
"\n" + Thread.currentThread().getName() + " Error @ arrowStreamProcessor",
926-
e);
927-
enqueueError(arrowBatchWrapperBlockingQueue, e);
928-
}
915+
LOG.log(
916+
Level.WARNING,
917+
"\n" + Thread.currentThread().getName() + " Error @ arrowStreamProcessor",
918+
e);
919+
enqueueError(arrowBatchWrapperBlockingQueue, e);
929920
} finally { // logic needed for graceful shutdown
930921
enqueueEndOfStream(arrowBatchWrapperBlockingQueue);
931922
}
@@ -1683,20 +1674,11 @@ private void parseAndPopulateRpcData(
16831674
}
16841675

16851676
} catch (Exception ex) {
1686-
if (ex.getCause() instanceof InterruptedException || Thread.currentThread().isInterrupted()) {
1687-
LOG.log(
1688-
Level.WARNING,
1689-
"\n" + Thread.currentThread().getName() + " Interrupted @ populateBufferAsync",
1690-
ex);
1691-
enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex);
1692-
Thread.currentThread().interrupt();
1693-
} else {
1694-
LOG.log(
1695-
Level.WARNING,
1696-
"\n" + Thread.currentThread().getName() + " Error @ populateBufferAsync",
1697-
ex);
1698-
enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex);
1699-
}
1677+
LOG.log(
1678+
Level.WARNING,
1679+
"\n" + Thread.currentThread().getName() + " Error @ populateBufferAsync",
1680+
ex);
1681+
enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex);
17001682
} finally {
17011683
enqueueBufferEndOfStream(bigQueryFieldValueListWrapperBlockingQueue);
17021684
}

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ public void testExecute_withOpenTelemetryGcpExporter() throws Exception {
7474
// pages)
7575
String paginationQuery = "SELECT * FROM UNNEST(GENERATE_ARRAY(1, 150)) AS id;";
7676
try (ResultSet paginatedRs = statement.executeQuery(paginationQuery)) {
77-
int rowCount = 0;
78-
while (paginatedRs.next() && rowCount < 150) {
79-
rowCount++;
77+
while (paginatedRs.next()) {
78+
// Drain the result set to trigger pagination fetches
8079
}
8180
}
8281
}

0 commit comments

Comments
 (0)