From b662ed24784253083468fcf8506753980b2d725d Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 17 Nov 2016 10:19:00 -0800 Subject: [PATCH] small tweaks to bigquery insert sql sample --- bigquery/api/src/functions/insert_sql.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bigquery/api/src/functions/insert_sql.php b/bigquery/api/src/functions/insert_sql.php index ed5b656911..97750d4d2f 100644 --- a/bigquery/api/src/functions/insert_sql.php +++ b/bigquery/api/src/functions/insert_sql.php @@ -24,7 +24,7 @@ namespace Google\Cloud\Samples\BigQuery; # [START insert_sql] -use Google\Cloud\ServiceBuilder; +use Google\Cloud\BigQuery\BigQueryClient; /** * @param string $projectId The Google project ID. @@ -33,12 +33,11 @@ */ function insert_sql($projectId, $datasetId, $source) { - // instantiate the bigquery table service - $builder = new ServiceBuilder([ + // instantiate the bigquery client + $bigQuery = new BigQueryClient([ 'projectId' => $projectId, ]); - $bigQuery = $builder->bigQuery(); - // create the import job + // run a sync query for each line of the import $file = fopen($source, 'r'); while ($line = fgets($file)) { if (0 !== strpos(trim($line), 'INSERT')) {