File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
bigquery/api/src/functions Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 2424namespace Google \Cloud \Samples \BigQuery ;
2525
2626# [START insert_sql]
27- use Google \Cloud \ServiceBuilder ;
27+ use Google \Cloud \BigQuery \ BigQueryClient ;
2828
2929/**
3030 * @param string $projectId The Google project ID.
3333 */
3434function insert_sql ($ projectId , $ datasetId , $ source )
3535{
36- // instantiate the bigquery table service
37- $ builder = new ServiceBuilder ([
36+ // instantiate the bigquery client
37+ $ bigQuery = new BigQueryClient ([
3838 'projectId ' => $ projectId ,
3939 ]);
40- $ bigQuery = $ builder ->bigQuery ();
41- // create the import job
40+ // run a sync query for each line of the import
4241 $ file = fopen ($ source , 'r ' );
4342 while ($ line = fgets ($ file )) {
4443 if (0 !== strpos (trim ($ line ), 'INSERT ' )) {
You can’t perform that action at this time.
0 commit comments