Cancelled Orders

Easy
Filtering
Snowflake

Cancelled Orders

Given orders, return rows where status = 'cancelled'. Project order_id, user_id, amount and order by order_id ascending.

Sample input

order_iduser_idstatusamount
30015returned235.46
3019returned759.05
30213shipped294.19
30310shipped373.23
30412shipped199.79
3054packed245.85
Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.orders10 rows
order_id (int)user_id (int)status (string)amount (double)
30015returned235.46
3019returned759.05
30213shipped294.19
30310shipped373.23
30412shipped199.79
3054packed245.85
3063shipped883.4
30710packed326.69
3087shipped991.46
3099cancelled231.92

Return these columns

order_id(int)
user_id(int)
amount(double)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.