Exemple #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();
        }
Exemple #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();
        }