Ejemplo n.º 1
0
        /// <inheritdoc />
        public override BigqueryJob CreateQueryJob(string sql, CreateQueryJobOptions options = null)
        {
            GaxRestPreconditions.CheckNotNull(sql, nameof(sql));
            var query = new JobConfigurationQuery {
                Query = sql
            };

            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(string sql, CreateQueryJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            GaxPreconditions.CheckNotNull(sql, nameof(sql));
            var query = new JobConfigurationQuery {
                Query = sql, UseLegacySql = false
            };

            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));
        }
        /// <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));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a query job, with more facilities than <see cref="ExecuteQuery"/>, including the option
 /// to store the results in a persistent table.
 /// </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 query job created. Use <see cref="GetQueryResults(JobReference,GetQueryResultsOptions)"/> to retrieve
 /// the results of the query.</returns>
 public virtual BigqueryJob CreateQueryJob(string sql, CreateQueryJobOptions options = null)
 {
     throw new NotImplementedException();
 }
 /// <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>
 /// 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();
 }