EmpezarEmpieza gratis

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?

Este ejercicio forma parte del curso

Intro to Snowflake for Devs, Data Scientists, Data Engineers

Ver curso

ejercicio interactivo práctico

Convierte la teoría en práctica con uno de nuestros ejercicios interactivos

Empezar ejercicio