/// <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));
        }
Exemplo n.º 3
0
        /// <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));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Executes a query synchronously.
 /// </summary>
 /// <param name="sql">The query in BigQuery's SQL dialect. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The result of the query.</returns>
 public virtual BigqueryResult ExecuteQuery(string sql, ExecuteQueryOptions options = null)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Executes a command. This overload allows query parameterization, and is preferred over
 /// <see cref="ExecuteQuery(string, ExecuteQueryOptions)"/> when values need to be passed in.
 /// </summary>
 /// <param name="command">The command to execute. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The result of the query.</returns>
 public virtual BigqueryQueryJob ExecuteQuery(BigqueryCommand command, ExecuteQueryOptions options = null)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Asynchronously executes a command. This overload allows query parameterization, and is preferred over
 /// <see cref="ExecuteQueryAsync(string, ExecuteQueryOptions,CancellationToken)"/> when values need to be passed in.
 /// </summary>
 /// <param name="command">The command to execute. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the <see cref="BigqueryQueryJob"/> representing the query.</returns>
 public virtual Task <BigqueryQueryJob> ExecuteQueryAsync(BigqueryCommand command, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
 internal BigqueryQueryJob(BigqueryClient client, QueryResponse response, ExecuteQueryOptions options)
     : this(client, ConvertQueryResponse(GaxPreconditions.CheckNotNull(response, nameof(response))), options?.ToGetQueryResultsOptions())
 {
 }