API에 연결하고 TSV 형식으로 보고서를 가져 오는 중입니다. Google BigQuery에 보고서를 업로드해야하지만 지금까지 찾은 모든 문서에서 Google Cloud Storage의 데이터를로드합니다. 별도의 URL에서 데이터를로드 할 수 있습니까? 난 그냥 그것을 통해 데이터를 전달하기 위하여려고하는 경우,Google BigQuery PHP URL에서 데이터로드
$service = new Google_BigqueryService($client);
// Your project number, from the developers.google.com/console project you created
// when signing up for BigQuery
$project_number = '*******';
// Information about the destination table
$destination_table = new Google_TableReference();
$destination_table->setProjectId($project_number);
$destination_table->setDatasetId('php_test');
$destination_table->setTableId('my_new_table');
// Information about the schema for your new table
$schema_fields = array();
$schema_fields[0] = new Google_TableFieldSchema();
$schema_fields[0]->setName('Date');
$schema_fields[0]->setType('string');
$schema_fields[1] = new Google_TableFieldSchema();
$schema_fields[1]->setName('PartnerId');
$schema_fields[1]->setType('string');
....
$destination_table_schema = new Google_TableSchema();
$destination_table_schema->setFields($schema_fields);
// Set the load configuration, including source file(s) and schema
$load_configuration = new Google_JobConfigurationLoad();
$load_configuration->setSourceUris(array('EXTERNAL URL WITH TSV'));
$load_configuration->setDestinationTable($destination_table);
$load_configuration->setSchema($destination_table_schema);
$job_configuration = new Google_JobConfiguration();
$job_configuration->setLoad($load_configuration);
$load_job = new Google_Job();
$load_job->setKind('load');
$load_job->setConfiguration($job_configuration);
$jobs = $service->jobs;
$response = $jobs->insert($project_number, $load_job);
내가이 Google 클라우드 스토리지에 대한 의미 실현,하지만 난 그것을 사용하고 싶지 않은 : 여기
내가 지금까지 가지고있는 코드입니다 한 시간 내에 삭제하십시오.외부 코드를 사용하고 데이터를로드 할 수있는 PHP 코드가 있습니까?
[BigQuery PHP API send json은 Google Cloud Storage에 없습니다.] (http://stackoverflow.com/questions/22589598/bigquery-php-api-send-json-that-isnt-in- google-cloud-storage) – Pentium10
광산은 조금 다릅니다. 나는 내가 밀어 넣어야 할 다른 곳에서 호스팅되는 tsv 파일을 가지고있다. 나는 한 번을 보게 될 것이다. 감사. –
레코드로 레코드를로드하고 BigQuery에 업로드하는 것 외에 다른 방법은 없습니다. URL 또는 파일 핸들러를 제공하는 API 호출이 없습니다. – Pentium10