Skip to content

NullPointerException calling bigquery listRoutines and listModels #849

@stephaniewang526

Description

@stephaniewang526

Below snippet is returning null when there is no Routines in the dataset:

    // clean up stale test routines in the test dataset
    Page<Routine> routines =
        bigquery.listRoutines(BIGQUERY_DATASET_NAME, BigQuery.RoutineListOption.pageSize(1000));
    for (Routine routine : routines.getValues()) {
      String routineName = routine.getRoutineId().getRoutine();
      if (routineName.contains("MY_ROUTINE_NAME_TEST_") && routine.getCreationTime() > sixHourAgo) {
        System.out.format("\tDeleting Routine: %s\n", routineName);
        bigquery.delete(RoutineId.of(PROJECT_ID, BIGQUERY_DATASET_NAME, routineName));
      }
    }

When there are Routines in the dataset, nullpointer is not thrown on listRoutines method.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/java-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions