LoslegenKostenlos starten

Snowpark DataFrames — Question 2

Building on the last question, now add this line to your import statements at the top of your Python Worksheet: from snowflake.snowpark.functions import col Then switch the line of code where you set df_table to session.sql(“SELECT * FROM TASTY_BYTES.RAW_POS.MENU LIMIT 10”) back to equalling session.table(TASTY_BYTES.RAW_POS.MENU). Okay, now add a new line of code where you use df_table.filter and COL to only pull out those rows where TRUCK_BRAND_NAME equals “The Mac Shack”, and set this equal to df_table. (There’s an example of this code in the video, except there we pulled all rows where TRUCK_BRAND_NAME equaled “Freezing Point”.) So your code should now be seven lines long—two lines with import statements, the line where main is defined, the line where you load df_table, the line where you filter df_table, the line where you call the show method on df_table, and the return line. When you run this worksheet, how many rows do you see in the result?

Diese Übung ist Teil des Kurses

<Kurs>Intro to Snowflake for Devs, Data Scientists, Data Engineers</Kurs>
Kurs ansehen

Interaktive praktische Übung

Verwandle Theorie mit einer unserer interaktiven Übungen in die Praxis

Übung starten