Amazon Top-Rated Products

Easy
Filtering
E-commerce
Amazon

Amazon Top-Rated Products

An Amazon-style catalog team highlights highly rated products.

Return product_id, product_name, rating for products rated at least 4.5. Sort by product_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.products7 rows
product_id (int)product_name (string)rating (double)
1Wireless Earbuds4.6
2Phone Case4.2
3Yoga Mat4.7
4Desk Lamp4.5
5Water Bottle4.4
6Backpack4.8
7Notebook4.1

Return these columns

product_id(bigint)
product_name(string)
rating(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.