Bulk Order Flag

Easy
Data Cleaning
Filtering

Bulk Order Flag

The orders table contains order IDs and item quantities.

Return order_id, quantity, is_bulk, where is_bulk is true when quantity is at least 50 and false otherwise. Sort by order_id ascending.

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.orders6 rows
order_id (int)quantity (int)
50112
50250
50349
504120
5055
50675

Return these columns

order_id(int)
quantity(int)
is_bulk(boolean)

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.