Sid
Sid

Reputation: 4510

Nothings happens when INSERTing row into Google Big Query with PHP

I am trying to insert single row of data into my demo project at Google Big Query. I am using PHP Google Cloud client library:

# Imports the Google Cloud client library
use Google\Cloud\BigQuery\BigQueryClient;

Creating tables or dataset works fine. But when i am trying normal insert with following code:

# Instantiates a client
$bigQuery = new BigQueryClient( [
    'projectId' => $projectId
] );

# The name for the new dataset
$datasetName = 'demo';

$tablaName = "demo";

$table = $bigQuery->dataset( $datasetName )
                  ->table( $tablaName );

$row = [
    'city' => 'Detroit',
    'state' => 'MI',
    'home' => 'black'
];

$insertResponse = $table->insertRow($row, [
    'insertId' => '1'
]);

I get just empty page, without any errors. If (for testing purposes) i am changing one of the data field names (let say "city" to non existing one "cityyy" - then i am getting errors that there are no such field with given name - it means that request works fine, but why i am getting empty white page? and no new rows are inserted into my demo table (i am checkint it with Big Query UI)?

Any thoughts?

Upvotes: 0

Views: 751

Answers (1)

Sid
Sid

Reputation: 4510

Ok, figured out...

Tried to make Select through API and all inserted rows showed up.

It seems that Google Big Query cache showed old results at google big query GUI (web interface).

Upvotes: 1

Related Questions