/// <inheritdoc /> public override BigqueryQueryJob ExecuteQuery(string sql, ExecuteQueryOptions options = null) { GaxPreconditions.CheckNotNull(sql, nameof(sql)); var queryRequest = new QueryRequest { Query = sql, UseLegacySql = false }; options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = request.Execute(); return(new BigqueryQueryJob(this, queryResponse, options)); }
/// <inheritdoc /> public override async Task <BigqueryQueryJob> ExecuteQueryAsync(string sql, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { GaxPreconditions.CheckNotNull(sql, nameof(sql)); var queryRequest = new QueryRequest { Query = sql, UseLegacySql = false }; options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigqueryQueryJob(this, queryResponse, options)); }
/// <inheritdoc /> public override BigqueryResult ExecuteQuery(string sql, ExecuteQueryOptions options = null) { GaxRestPreconditions.CheckNotNull(sql, nameof(sql)); var queryRequest = new Apis.Bigquery.v2.Data.QueryRequest { Query = sql }; options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = request.Execute(); return(new BigqueryResult(this, queryResponse)); }
/// <inheritdoc /> public override BigqueryQueryJob ExecuteQuery(BigqueryCommand command, ExecuteQueryOptions options = null) { GaxPreconditions.CheckNotNull(command, nameof(command)); var queryRequest = new QueryRequest { UseLegacySql = false }; command.PopulateQueryRequest(queryRequest); options?.ModifyRequest(queryRequest); var request = Service.Jobs.Query(queryRequest, ProjectId); var queryResponse = request.Execute(); return(new BigqueryQueryJob(this, queryResponse, options)); }