Пример #1
0
 private QueryResponse(BigQueryContext context, string query, TimeSpan executionTime,
                       GetQueryResultsResponse queryResponse, bool isDynamic, IRowsParser rowsParser)
     : this(
         context, query, executionTime, isDynamic, rowsParser, queryResponse.Rows, queryResponse.Schema,
         queryResponse.CacheHit, queryResponse.ETag, queryResponse.Kind,
         queryResponse.PageToken, queryResponse.TotalBytesProcessed, queryResponse.TotalRows,
         queryResponse.JobComplete, queryResponse.JobReference)
 {
 }
Пример #2
0
        private QueryResponse(BigQueryContext context, string query, TimeSpan executionTime, bool isDynamic,
                              IRowsParser rowsParser, IList <TableRow> rows, TableSchema schema, bool?cacheHit, string eTag, string kind,
                              string pageToken, long?totalBytesProcessed, ulong?totalRows,
                              bool?jobComplete, JobReference jobReference)
        {
            _context    = context;
            _isDynamic  = isDynamic;
            _rowsParser = rowsParser;

            Rows = rows == null
                ? new T[0]
                : rowsParser.Parse <T>(
                context.fallbacks,
                context.IsConvertResultUtcToLocalTime,
                schema,
                rows,
                isDynamic).ToArray();

            TableFieldSchemas = (schema == null)
                ? new TableFieldSchema[0]
                : schema.Fields;

            Query               = query;
            ExecutionTime       = executionTime;
            CacheHit            = cacheHit;
            ETag                = eTag;
            Kind                = kind;
            PageToken           = pageToken;
            TotalBytesProcessed = totalBytesProcessed;
            TotalRows           = totalRows;

            TotalBytesProcessedFormatted = totalBytesProcessed.ToHumanReadableSize();

            _jobComplete  = jobComplete.GetValueOrDefault(false);
            _jobReference = jobReference;
        }
Пример #3
0
 public BigQueryContext(IRowsParser rowsParser, BigqueryService service, string projectId)
     : this(rowsParser)
 {
     this.BigQueryService = service;
     this.ProjectId       = projectId;
 }
Пример #4
0
 public BigQueryContext(IRowsParser rowsParser)
 {
     this.IndentSize = 2;
     this.IsConvertResultUtcToLocalTime = true;
     this._rowsParser = rowsParser;
 }