cancel
Showing results for 
Search instead for 
Did you mean: 
dylanwan
Employee
Employee

Introduction

The incorta_sql_pg() function lets you directly query business schema data in a PySpark MV without going through the old and cumbersome way. 

What you need to know before reading this article

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 

suxinji_0-1666130503884.png

Incorta Version

Incorta 2022.10.0 or later

Let's Go

 

df = incorta_sql_pg("""
SELECT
    *
FROM
    BUSINESS_SCHEMA_NAME.BUSINESS_VIEW_NAME
""")

 

Example: 

suxinji_1-1666130748097.png

Related Material

Best Practices Index
Best Practices

Just here to browse knowledge? This might help!

Contributors
Version history
Last update:
‎10-26-2022 09:49 AM
Updated by: