-1

Cloud Spanner supports GQL, and it's possible to set Spanner as an external dataset for BigQuery, such as indicated here. Given this, is it possible to execute a GQL query in BigQuery, even if written as a string to be executed at Spanner? If so, how could this be done?

1 Answer 1

0

You can set up an external connection from Cloud Spanner to BigQuery and run it using that connection id, for example the following Cloud Spanner database has connection id US.1234:

SELECT * FROM EXTERNAL_QUERY("myproject.US.1234", """
GRAPH FinGraph
MATCH
  (from_person:Person {name: "Dana"})-[:Owns]->
  (from_account:Account)-[transfer:Transfers]->
  (to_account:Account)<-[:Owns]-(to_person:Person)
RETURN
  from_person.name AS from_account_owner,
  from_account.id AS from_account_id,
  to_person.name AS to_account_owner,
  to_account.id AS to_account_id,
  transfer.amount AS amount
""");

See the EXTERNAL QUERY function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.