private InsertRequest CreateInsertTableRequest(TableReference tableReference, Table resource, CreateTableOptions options) { CheckResourceForCreation(tableReference, resource); resource.TableReference ??= tableReference; var request = Service.Tables.Insert(resource, tableReference.ProjectId, tableReference.DatasetId); options?.ModifyRequest(request); return(request); }
private InsertRequest CreateInsertTableRequest(TableReference tableReference, TableSchema schema, CreateTableOptions options) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); var table = new Table { TableReference = tableReference, Schema = schema }; var request = Service.Tables.Insert(table, tableReference.ProjectId, tableReference.DatasetId); options?.ModifyRequest(table, request); return(request); }
/// <inheritdoc /> public override BigQueryTable CreateTable(TableReference tableReference, TableSchema schema, CreateTableOptions options = null) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); var table = new Table { TableReference = tableReference, Schema = schema }; var request = Service.Tables.Insert(table, tableReference.ProjectId, tableReference.DatasetId); options?.ModifyRequest(table, request); var result = request.Execute(); return(new BigQueryTable(this, result)); }
/// <inheritdoc /> public override async Task <BigQueryTable> CreateTableAsync(TableReference tableReference, TableSchema schema, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); var table = new Table { TableReference = tableReference, Schema = schema }; var request = Service.Tables.Insert(table, tableReference.ProjectId, tableReference.DatasetId); options?.ModifyRequest(table, request); var result = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false); return(new BigQueryTable(this, result)); }