Database Reference
In-Depth Information
As previously mentioned the Simba driver transparently rewrites standard
SQL into BigQuery SQL. Often, this is exactly what you want; you may have
a tool that generates standard SQL, and you want to use BigQuery without
changing your queries. Sometimes, however, you may want to express a
query in BigQuery SQL exactly. Maybe you want to take advantage of nested
and repeated data, or use the EACH keyword to allow JOIN operations
between two large tables.
If you want to write queries in BigQuery SQL and not Standard SQL, you
can tell the Simba driver to pass through the SQL statements exactly and
not perform any transformations. To do this, click the Advanced Options
button, which hides an important check box: Use Native Queries, which
defaults to unchecked. Checking the box causes the driver to pass through
queries exactly as they are written. You may also have the option of
overriding these options when you create an ODBC connection.
In ODBC terms, the Simba BigQuery ODBC connector maps a project to an
ODBC catalog; this means you need to choose ahead of time which project
you will use. For most practical purposes this is not a problem because most
people use a single project in their queries. When you write queries, you
should use the dataset name and table name only; the project name will
be implicit. For example, the query you might run in the BigQuery web
UI SELECT COUNT(*) FROM [publicdata:samples.shakespeare]
would look like SELECT COUNT(*) FROM samples.shakespeare when
using the ODBC driver; the publicdata project ID must be specified in the
connection settings.
ODBC Queries from the .NET Framework
ODBC is a platform-dependent mechanism; if you use ODBC to talk to
your data source, you're probably using Windows. The most common
programming environment on Windows is the Common Language Runtime
(CLR), which allows you to program in a number of different languages
using identical APIs. The flagship programming language under the CLR is
C#. Because we expect that C# will be the most relevant language for users
of the Simba BigQuery ODBC driver, we've provided C# sample code to talk
to BigQuery via ODBC in Listing 13.1 .
Listing
13.1 :
Simple
ODBC
query
application
(C#)
(bigquery_odbc.cs)
 
 
 
 
Search WWH ::




Custom Search