You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cursor = buffer.take(); // advance the cursor,Potentially blocking operation
When we run query Using Fast Query Path (Read API disabled) such code works fine.buffer.take() returns cursor and it correctly indicated in isEndOfStream as EndOfFieldValueList.
But when we enable Read API buffer.take() throws NPE since buffer is null.
Environment details
com.google.cloud:google-cloud-bigquery:2.45.0
Mac OS Sonoma M1
Java version: 17
Steps to reproduce
Enable Read API (make sure you see Not Using Fast Query Path, using jobs.insert, see related issue I've attached)
Read the empty table
Execute next()
Code example
val connectionSettings =ConnectionSettings.newBuilder()
.setJobTimeoutMs(Long.MAX_VALUE) // that is crucial to enable Read API, see the attached issue
.setRequestTimeout(DEFAULT_QUERY_TIMEOUT_MS)
.setUseReadAPI(true)
.setMaxResults(DEFAULT_MAX_RESULT)
.setUseQueryCache(true)
.build()
val connection = context.createConnection(connectionSettings)
val bqResult = connection.executeSelect(code)
bqResult.resultSet.next() // NPE
Stack trace
onError(java.lang.NullPointerException: Cannot invoke "java.util.concurrent.BlockingQueue.take()" because the return value of "com.google.cloud.bigquery.BigQueryResultImpl.access$200(com.google.cloud.bigquery.BigQueryResultImpl)" is null))
at com.google.cloud.bigquery.BigQueryResultImpl$BigQueryResultSet.next(BigQueryResultImpl.java:120)
We get NPE when we read an empty table using Read API.
NPE happens here:
java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java
Line 120 in 4061922
When we run query
Using Fast Query Path
(Read API disabled) such code works fine.buffer.take()
returns cursor and it correctly indicated inisEndOfStream
asEndOfFieldValueList
.But when we enable Read API
buffer.take()
throws NPE since buffer is null.Environment details
com.google.cloud:google-cloud-bigquery:2.45.0
Mac OS Sonoma M1
Java version: 17
Steps to reproduce
Not Using Fast Query Path, using jobs.insert
, see related issue I've attached)Code example
Stack trace
Related issue: googleapis/java-bigquerystorage#2764
#3624
The text was updated successfully, but these errors were encountered: