簡體   English   中英

如何使用PHP編寫類似SQL的查詢以從BigQuery獲取數據

[英]How to write a sql like query using PHP to get data from BigQuery

有人可以給我一個例子,其中可以使用當前的客戶端庫通過php和sql之類的查詢通過php訪問BigQuery嗎?

在新庫中,憑據作為json給出,與舊版本相比,其他更改很少,而且我不知道如何運行查詢。 因此,如果有人可以提供示例代碼,那就太好了

    $bigQuery = $this->getBigQuery();

    $tableName = $bigQuery->constructTableName('example');

    $query = $bigQuery->client->queryConfig("
        select distinct id from {$tableName}
    ");

    $queryJobConfig = $this->bigQuery->client->query($query);
    $this->$bigQuery->client->runQuery($queryJobConfig);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM