From the course: Snowpark for Data Engineers
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Data transformations using Snowpark DataFrames - Snowflake Tutorial
From the course: Snowpark for Data Engineers
Data transformations using Snowpark DataFrames
- [Instructor] Every dataframe returned by the session.table command has a schema property that you can use to access the schema of that dataframe. Here I call .schema on the dataframe returned by session.table and I print out the table schema. The table schema is of a struct type. You can see struct fields to represent the different fields and the types of the different fields as well. Let's look at some data manipulation that you can do with SnowparkDataFrames. Rather than selecting all of the columns in our table and storing that in a dataframe, let's say you want just a few selected columns. You can call the .select method on a dataframe and pass in column objects that you're interested in. Name, serving size, and calories. The resulting dataframe has only the columns that we had specified in our select method. Next, let's see how we can perform a simple filter operation. Session.table returns a dataframe. I invoke the .filter method on a dataframe and I specify that I want the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Using Snowpark from a locally running Jupyter Notebook5m 31s
-
(Locked)
Data transformations using Snowpark DataFrames2m 3s
-
(Locked)
Performing union operations on DataFrames2m 37s
-
(Locked)
Performing joins3m 29s
-
(Locked)
Creating views4m 4s
-
(Locked)
Working with semi-structured data3m 15s
-
(Locked)
-
-
-
-