I a little confuse because I hard to find detail example of documentation how to this
I want to query data at temporary table from previous select query in BigQuery using API on PHP
function run_query($query, $useLegacySql, &$result)
{
$builder = new ServiceBuilder([
'projectId' => 'PROJECTID',
]);
$job = new Google_Job();
$bigQuery = $builder->bigQuery();
$queryResults = $bigQuery->runQuery(
$query,
['useLegacySql' => $useLegacySql]);
if ($queryResults->isComplete())
{
$i = 0;
$rows = $queryResults->rows();
foreach ($rows as $row)
{
$i++;
$result[$i] = $row;
}
}
else
{
throw new Exception('The query failed to complete');
}
}
So my question is if I run this function to execute my select query for example "SELECT username FROM user_activities", how can I get the temporary table from this select query and execute the next query from this temporary table?
I know there is Jobs API on BigQuery but I still confuse how to implement it?
Thanks