0% found this document useful (0 votes)
51 views

Views

Uploaded by

forotheuse123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Views

Uploaded by

forotheuse123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Views

Learning Objectives

u Views
u Types of views

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


View

u Logical query against source tables


A1 A4 B2 B3 CREATE VIEW view_x
AS SELECT A1, A4, B2, B3
FROM table_1
INNER JOIN table_2 …
view_x

A1 A2 A3 A4 B1 B2 B3 B4

table_1 table_2
Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation
Types of views

1. (Stored) Views

2. Temporary views

3. Global Temporary views

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


1- (Stored) Views

u Persisted objects

u CREATE VIEW view_name


AS query

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


2- Temporary view

u Session-scoped view

u CREATE TEMP VIEW view_name


AS query

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


Spark Session

u Opening a new notebook

u Detaching and reattaching to a cluster

u Installing a python package

u Restarting a cluster

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


3- Global Temporary views

u Cluster-scoped view

u CREATE GLOBAL TEMP VIEW view_name


AS query

u SELECT * FROM global_temp.view_name

Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation


Views comparison

(Stored) Views Temp views Global Temp views


u Persisted in DB u Session-scoped u Cluster-scoped

u Dropped only by u dropped when u dropped when


DROP VIEW session ends cluster restarted

u CREATE VIEW u CREATE TEMP VIEW u CREATE GLOBAL


TEMP VIEW
Derar Alhussein © Udemy | Databricks Certified Data Engineer Associate - Preparation

You might also like