Monday, June 27, 2016

[google-cloud-sql-discuss] Re: Query Google Big Query from Cloud SQl

Hajar,

ParaSQL's Hyper Connect Engine is a MySQL compatible database engine that runs on Google Compute Engine. Unlike CloudSQL, it allows you to add linked servers sort of like a Microsoft SQL linked server (or federated tables in MySQL) but using any data source that has an ODBC driver available (JDBC coming soon). There are several commercial ODBC drivers available for BigQuery (for example, from Simba Technologies). Once the servers are connected, you can simply issue a command like:

insert into MySQLTable
select a,b from BigQueryTable where ...

You can also dynamically join across MySQL and BigQuery without copying the data first. So something like this is valid:

select t1.col1, t2.col3
from MySQLTable as t1
left join BigQueryTable on (BigQueryTable.col1 = MySQLTable.col7) as t2
where BigQueryTable.col12 between 45 and 56
order by BigQueryTable.col2, MySQLTable.col5

GROUP BY and aggregates (sum,min,avg,etc) also work. Nested sub-select syntax also works.
There WHERE clause is pushed down to BigQuery, so this works well so long as the amount of data coming back from the BigQuery part of the query isn't too huge.


On Friday, June 17, 2016 at 1:11:56 PM UTC-4, Hajar Homayouni wrote:
Hi all,

I have a large dataset in GBQ, and I want to query (select) a small part of it in Cloud SQL. Is there any way to do this?


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/b9c14379-cae6-4942-bf06-ee5c7a94fc79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment