我正在尝试将数据加载到 BigQuery 中,并且加载作业无限期地保持在挂起状态(我等了大约 5 分钟)。我还需要做些什么才能将工作转移到运行状态吗?
log.log(new LogRecord(Level.INFO, "Writing to big query table"));
JobConfigurationLoad loadConf = new JobConfigurationLoad();
loadConf.setDestinationTable(new TableReference().setProjectId(PROJECT_ID)
.setDatasetId(datasetId).setTableId(TABLE_ID));
loadConf.setWriteDisposition("WRITE_APPEND");
loadConf.setSourceUris(Arrays.asList("gs://" + bucket + "/" + "something.json"));
JobConfiguration configuration = new JobConfiguration().setLoad(loadConf);
Job loadJob = new Job().setConfiguration(configuration);
Jobs.Insert insertData = bigQuery.jobs().insert(PROJECT_ID, loadJob);
Job insertResp = insertData.execute();
JobStatus status = insertResp.getStatus();
while (!status.getState().equals("done")) {
System.out.println(status.getState());
status = insertResp.getStatus();
Thread.sleep(10000);
}
...