goccy / bigquery-emulator

BigQuery emulator server implemented in Go
MIT License
843 stars 108 forks source link

Add support for CREATE_IF_NEEDED disposition for queries with destination table specified #360

Open myhau opened 1 month ago

myhau commented 1 month ago

What would you like to be added?

CREATE_IF_NEEDED is already supported for load jobs. It would also be nice to support it for queries that specify the destination table.

Example code that uses Java SDK:

 QueryJobConfiguration queryConfig =
          QueryJobConfiguration.newBuilder(query)
              .setDestinationTable(tableId)
              .setCreateDisposition(CREATE_IF_NEEDED)
              .build();

long current = Instant.now().getEpochSecond();
bigQuery.query(queryConfig);