2016-11-19 2 views
1

Google 스프레드 시트에 데이터가있는 페더 레이 티브 테이블을 쿼리했습니다. 내가 다음 코드를 생성 한 문제 (720) https://code.google.com/p/google-bigquery/issues/detail?id=720 의 권고에 따라 :BigQuery : 파일 패턴을 globbing하는 중에 오류가 발생했습니다.

Set<String> scopes = new HashSet<>(); 
    scopes.add(BigqueryScopes.BIGQUERY); 
    scopes.add("https://www.googleapis.com/auth/drive"); 
    scopes.add("https://www.googleapis.com/auth/spreadsheets"); 
    final HttpTransport transport= new NetHttpTransport(); 
    final JsonFactory jsonFactory= new JacksonFactory(); 
    GoogleCredential credential = new GoogleCredential.Builder() 
       .setTransport(transport).setJsonFactory(jsonFactory) 
       .setServiceAccountId(GC_CREDENTIALS_ACCOUNT_EMAIL) 
       .setServiceAccountScopes(scopes) 
       .setServiceAccountPrivateKey(getPrivateKey())  
       .build(); 
    String omgsql = "SELECT * FROM [<myproject>:<mydataset>.failures] LIMIT 1000"; 
    JobReference jobIdomg = startQuery(bigquery, "<myproject>", omgsql); 

    // Poll for Query Results, return result output 
    Job completedJobomg = checkQueryResults(bigquery, "<myproject>", jobIdomg); 
    GetQueryResultsResponse queryResultomg = bigquery.jobs() 
     .getQueryResults(
      "<myproject>", completedJobomg 
       .getJobReference() 
       .getJobId() 
     ).execute(); 
    List<TableRow> rowsomg = queryResultomg.getRows(); 

https://www.googleapis.com/auth/drive 범위 작업, 그것으로 삽입 한 후 즉시 실패 없이하는 것은 - 완료에 실패합니다.

Inserting Query Job: SELECT * FROM [<myproject>:<mydataset>.failures] LIMIT 1000 
Job ID of Query Job is: job_S3-fY5jrb4P3UhVgNGeRkDYQofg 
Job status (194ms) job_S3-fY5jrb4P3UhVgNGeRkDYQofg: RUNNING 
Job status (1493ms) job_S3-fY5jrb4P3UhVgNGeRkDYQofg: RUNNING 
Job status (2686ms) job_S3-fY5jrb4P3UhVgNGeRkDYQofg: RUNNING 
... 
Job status (29881ms) job_S3-fY5jrb4P3UhVgNGeRkDYQofg: DONE 
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request 
{ 
    "code" : 400, 
    "errors" : [ { 
    "domain" : "global", 
    "location" : "/gdrive/id/1T4qNgi9vFJF4blK4jddYf8XlfT6uDiqNpTExWf1NMyY", 
    "locationType" : "other", 
    "message" : "Encountered an error while globbing file pattern.", 
    "reason" : "invalid" 
    } ], 
    "message" : "Encountered an error while globbing file pattern." 
} 
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145) 

그래서 여기에 질문이 있습니다. 그 밖의 무엇이 있습니까? 아니면 그냥 bigquery 버그입니까?

답변

3

실험 일 후에 Google 자격증을 취득하기 위해 사용하는 계정에서 외부 테이블이 생성 된 파일에 액세스 할 수 있어야합니다. 희망이 사람을 도울 것입니다.

관련 문제