Пример #1
0
        public void PopulateTable(
            string query, string datasetId, string newTableId, BigQueryClient client)
        {
            var         destination = client.GetTableReference(datasetId, newTableId);
            BigQueryJob job         = client.CreateQueryJob(query,
                                                            new CreateQueryJobOptions {
                DestinationTable = destination
            });

            // Wait for the job to complete.
            job.PollQueryUntilCompleted();
        }
Пример #2
0
        // [START copy_table]
        public void CopyTable(
            string datasetId, string tableIdToBeCopied, string newTableId, BigQueryClient client)
        {
            var         table       = client.GetTable(datasetId, tableIdToBeCopied);
            string      query       = $"SELECT * FROM {table}";
            var         destination = client.GetTableReference(datasetId, newTableId);
            BigQueryJob job         = client.CreateQueryJob(query,
                                                            new CreateQueryJobOptions {
                DestinationTable = destination
            });

            // Wait for the job to complete.
            job.PollQueryUntilCompleted();
        }