dolthub / dolthub/dolt

Allow querying remote MySQL data sources

Open
#10,285 0 comments 0 reactions 0 assignees View on GitHub
customer issue enhancement
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

The ability to federate queries to different data sources would be useful to customers for scenarios such as when remote data needs to be combined with local data for query results.

One approach for this is providing a new table function that can query a remote MySQL data source. This provides an explicit interface for querying a remote MySQL server, instead of a more complex, implicit approach where the query planner must identify which tables are remote in a query.

BigQuery provides this functionality through its [`EXTERNAL_QUERY()` function](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/federated_query_functions#external_query).

```sql
SELECT * FROM myLocalTable
LEFT JOIN EXTERNAL_QUERY('us.prod_remote_db', 'SELECT * FROM myRemoteTable') T ON myLocalTable.id = T.id
WHERE T.id = 1;
```

Implementation of the table function should be fairly straightforward. One design issue we would need to solve is authentication params for the remote server. BigQuery addresses this by allowing admin users to create a connection resource that contains all the connection information, then grants users privileges to use that connection resource in external queries.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.