/// <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)); }
/// <inheritdoc /> public override async Task <BigqueryQueryJob> ExecuteQueryAsync(BigqueryCommand command, ExecuteQueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { 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 = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigqueryQueryJob(this, queryResponse, options)); }
/// <inheritdoc /> public override BigqueryJob CreateQueryJob(BigqueryCommand command, CreateQueryJobOptions options = null) { GaxPreconditions.CheckNotNull(command, nameof(command)); var query = new JobConfigurationQuery { UseLegacySql = false }; command.PopulateJobConfigurationQuery(query); options?.ModifyRequest(query); var job = Service.Jobs.Insert(new Job { Configuration = new JobConfiguration { Query = query }, }, ProjectId).Execute(); return(new BigqueryJob(this, job)); }
/// <inheritdoc /> public override async Task <BigqueryJob> CreateQueryJobAsync(BigqueryCommand command, CreateQueryJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { GaxPreconditions.CheckNotNull(command, nameof(command)); var query = new JobConfigurationQuery { UseLegacySql = false }; command.PopulateJobConfigurationQuery(query); options?.ModifyRequest(query); var job = await Service.Jobs.Insert(new Job { Configuration = new JobConfiguration { Query = query }, }, ProjectId).ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigqueryJob(this, job)); }
/// <summary> /// Creates a job for a query/command, with more facilities than <see cref="ExecuteQuery(BigqueryCommand, ExecuteQueryOptions)"/>, /// including the option to store the results in a persistent table. This overload allows query parameterization, and is preferred over /// <see cref="CreateQueryJob(string, CreateQueryJobOptions)"/> 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 query job created. Use <see cref="GetQueryResults(JobReference,GetQueryResultsOptions)"/> to retrieve /// the results of the query.</returns> public virtual BigqueryJob CreateQueryJob(BigqueryCommand command, CreateQueryJobOptions 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 creates a job for a query/command, with more facilities than <see cref="ExecuteQueryAsync(BigqueryCommand, ExecuteQueryOptions,CancellationToken)"/>, /// including the option to store the results in a persistent table. This overload allows query parameterization, and is preferred over /// <see cref="CreateQueryJobAsync(string, CreateQueryJobOptions,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 query job created. Use <see cref="GetQueryResultsAsync(JobReference,GetQueryResultsOptions,CancellationToken)"/> to retrieve /// the results of the query.</returns> public virtual Task <BigqueryJob> CreateQueryJobAsync(BigqueryCommand command, CreateQueryJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }