Query Synthetic Data via client libraries

using Google.Cloud.BigQuery.V2;

string projectId = "udp-unizin-prod";
string sql = @"SELECT id FROM `unizin-shared.event_store.expanded`
WHERE event_time BETWEEN DATETIME('2021-02-25') AND DATETIME('2021-02-26')
ORDER BY event_time DESC
LIMIT 1";

BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryParameter[] parameters = null;
BigQueryResults results = client.ExecuteQuery(sql, parameters);
foreach (BigQueryRow row in results)
{
    Console.WriteLine($"{row["id"]}");
}
$ dotnet run
urn:uuid:d75e6fc8-ab88-4f25-accf-a1558ae9de6e

See more at https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest

Last updated

Logo

Copyright © 2023, Unizin, Ltd.