2012-09-15 102 views
1

如何獲取查詢使用C#在BigQuery查詢中執行的時間和其他參數等數據。大查詢查詢統計

  QueryRequest _r = new QueryRequest(); 
      _r.Query = "SELECT Id, Name FROM [Sample.Test] LIMIT 1000"; 
      QueryResponse _qr = _service.Jobs.Query(_r, "samplequery").Fetch(); 

      List<string> _fieldNames = _qr.Schema.Fields.ToList().Select(x => x.Name).ToList() ; 

      List<Google.Apis.Bigquery.v2.Data.TableRow> _rows = _qr.Rows.ToList(); 

有JobStatistics類,但我沒有從上面的查詢執行得到工作統計。否則如果有任何其他方式獲得統計資料,請提出建議。

謝謝

回答

3

我明白了。

  Job _j = _service.Jobs.Get(_qr.JobReference.ProjectId, _qr.JobReference.JobId).Fetch(); 

      JobStatistics _js = _j.Statistics; 

      this.StartTime = _js.StartTime; 
      this.EndTime = _js.EndTime; 
      this.BytesProcessed = _js.TotalBytesProcessed;