File tree Expand file tree Collapse file tree
java-bigquery/google-cloud-bigquery/src
main/java/com/google/cloud/bigquery
test/java/com/google/cloud/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2526,13 +2526,10 @@ && getOptions().getOpenTelemetryTracer() != null) {
25262526 throw new BigQueryException (bigQueryErrors );
25272527 }
25282528
2529- // If query is incomplete, fallback to fetching the Job .
2529+ // If query is incomplete, Arrow format for slow query path is not yet supported .
25302530 if (!Boolean .TRUE .equals (results .getJobComplete ())) {
2531- if (results .getJobReference () == null ) {
2532- throw new BigQueryException (0 , "Job is incomplete, but no job reference was returned." );
2533- }
2534- JobId jobId = JobId .fromPb (results .getJobReference ());
2535- return getJob (jobId , options );
2531+ throw new UnsupportedOperationException (
2532+ "Arrow results format for slow query path execution is not yet supported." );
25362533 }
25372534
25382535 // If query is complete but Arrow schema is missing or invalid, fallback to standard JSON
Original file line number Diff line number Diff line change @@ -3287,6 +3287,31 @@ void testQueryWithArrowFormatMissingSerializedSchema() throws Exception {
32873287 assertTrue (e .getMessage ().contains ("Arrow schema is missing from the response" ));
32883288 }
32893289
3290+ @ Test
3291+ void testQueryWithArrowFormatIncompleteJob () throws Exception {
3292+ JobId queryJob = JobId .of (PROJECT , JOB ).toBuilder ().setLocation (LOCATION ).build ();
3293+ com .google .api .services .bigquery .model .QueryResponse queryResponsePb =
3294+ new com .google .api .services .bigquery .model .QueryResponse ()
3295+ .setQueryId ("q-arrow-incomplete" )
3296+ .setJobComplete (false )
3297+ .setJobReference (queryJob .toPb ());
3298+
3299+ when (bigqueryRpcMock .queryRpcSkipExceptionTranslation (eq (PROJECT ), any (QueryRequest .class )))
3300+ .thenReturn (queryResponsePb );
3301+
3302+ bigquery = options .getService ();
3303+
3304+ QueryJobConfiguration config =
3305+ QueryJobConfiguration .newBuilder ("SELECT id FROM test" )
3306+ .setQueryResultsFormat (QueryResultsFormat .ARROW )
3307+ .build ();
3308+ UnsupportedOperationException e =
3309+ assertThrows (UnsupportedOperationException .class , () -> bigquery .query (config ));
3310+ assertTrue (
3311+ e .getMessage ()
3312+ .contains ("Arrow results format for slow query path execution is not yet supported." ));
3313+ }
3314+
32903315 @ Test
32913316 void testGetQueryResults () throws IOException {
32923317 JobId queryJob = JobId .of (JOB );
You can’t perform that action at this time.
0 commit comments