on 10-25-2022 08:38 AM - edited on 10-26-2022 09:49 AM by Tristan
The incorta_sql_pg() function lets you directly query business schema data in a PySpark MV without going through the old and cumbersome way.
Previously, you could use spark.sql() to query the data from physical schema data by creating temp views.
Let's review the previously tedious steps:
Go to Business Schema -> Explore Data -> SQL generation -> Copy the Reference SQL to Notebook -> Load data and create temp view -> Copy and edit the Reference SQL in spark.sql() function
Incorta 2022.10.0 or later
df = incorta_sql_pg("""
SELECT
*
FROM
BUSINESS_SCHEMA_NAME.BUSINESS_VIEW_NAME
""")
Example: