Stay organized with collections Save and categorize content based on your preferences.
SAP Datasphere federated queriesPreview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see the launch stage descriptions.
Note: To get support or provide feedback for this preview feature, contact bq-sap-federation-support@google.com.As a data analyst, you can query relational data in SAP Datasphere from BigQuery using federated queries.
BigQuery SAP Datasphere federation lets BigQuery query data residing in SAP Datasphere in real time, without copying or moving data.
To run a SQL query in SAP Datasphere, specify that SQL query within BigQuery in a EXTERNAL_QUERY
function. The results are then transferred from SAP Datasphere to BigQuery.
EXTERNAL_QUERY
.Ensure that your BigQuery administrator has created a SAP Datasphere connection and shared it with you.
Required rolesTo get the permissions that you need to query SAP Datasphere, ask your administrator to grant you the BigQuery Connection User (roles/bigquery.connectionUser
) IAM role on the project. For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Query dataTo send a federated query to SAP Datasphere from a GoogleSQL query, use the EXTERNAL_QUERY function.
The following example is a federated query that joins a table in SAP Datasphere named ORDERS
and a table in BigQuery named mydataset.customers
.
SELECT c.customer_id, c.name, rq.first_order_date
FROM mydataset.customers AS c
LEFT OUTER JOIN EXTERNAL_QUERY(
'connection_id',
'''SELECT CUSTOMER_ID, MIN(ORDER_DATE) AS first_order_date
FROM ORDERS
GROUP BY CUSTOMER_ID''') AS rq
ON rq.customer_id = c.customer_id
GROUP BY c.customer_id, c.name, rq.first_order_date;
View a SAP Datasphere table schema
The following examples use the EXTERNAL_QUERY function to retrieve database metadata from the SYS
schema in SAP Datasphere.
-- List all views in a schema.
SELECT * FROM EXTERNAL_QUERY(
'connection_id',
'''SELECT VIEW_NAME FROM SYS.VIEWS
WHERE SCHEMA_NAME = 'MY_SCHEMA'''');
-- List all columns in a view.
SELECT * FROM EXTERNAL_QUERY(
'connection_id',
'''SELECT COLUMN_NAME, DATA_TYPE_NAME
FROM SYS.VIEW_COLUMNS
WHERE SCHEMA_NAME = 'MY_SCHEMA' AND
VIEW_NAME = 'my_view'
ORDER BY POSITION''');
Pricing
The cost of running a federated query is based on three factors:
Any SAP Datasphere related costs depend on the type of SAP service you use. To limit the bandwidth cost, we recommend that you write the query in the EXTERNAL_QUERY
so that it excludes all columns and rows that are not needed to compute the final result.
There is no additional cost for running federated queries in BigQuery. For more information about BigQuery pricing, see Pricing.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["BigQuery's SAP Datasphere federation allows real-time querying of data in SAP Datasphere without data replication."],["Federated queries to SAP Datasphere are executed using the `EXTERNAL_QUERY` function within BigQuery, with results transferred back to BigQuery."],["This feature is currently in a Pre-GA phase and has limitations, including querying only relational views exposed for consumption, potential higher latency, and no SQL pushdown support."],["Users require the BigQuery Connection User IAM role to query SAP Datasphere and must have an existing shared connection."],["The cost of federated queries is based on compute in both SAP Datasphere and BigQuery, and bandwidth for transferring results."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4