Step 2: Query without data filters
After you set up the environment, you can query the product reviews table. First query the table without row-level access controls to make sure you can see the data. If you are running queries in Amazon Athena for the first time, you need to configure the query result location.
Query the table without row-level access control
-
Sign into Athena console at https://console.aws.amazon.com/athena/
as the DatalakeAdmin
user, and run the following query:SELECT * FROM lakeformation_tutorial_row_security.amazon_reviews LIMIT 10
The following screenshot shows the query result. This table has only one partition,
product_category=Video
, so each record is a review comment for a video product. -
Next, run an aggregation query to retrieve the total number of records per
marketplace
.SELECT marketplace, count(*) as total_count FROM lakeformation_tutorial_row_security.amazon_reviews GROUP BY marketplace
The following screenshot shows the query result. The
marketplace
column has five different values. In the subsequent steps, you will set up row-based filters using themarketplace
column.