As you may recall, a developer now has access to the sales_event table. Login to your AWS account as the user lf-developer. Let see how can we query real-time data using Amazon Athena.
From the AWS Management console, search for Amazon Athena service.
Make sure you are logged in as a lf-developer.
Please select the tpc database.
Select the dl_tpc_sales_event table and see the columns that were added by the Glue Crawler.
Run the following query:
SELECT*FROM"tpc"."dl_tpc_sales_event"limit10;
This query is going to show a sample of the data that is inside the table
Run the following query every 60 seconds and you will notice how the number of records increases:
Now, let's try to query the same table with another user without access to the dl_tpc_sales_even table and see what happens. Login to your AWS account as the user lf-business-analyst (default password: Password1!).
From the AWS Management console, search for Amazon Athena service.
Make sure you are logged in as a lf-business-analyst user.
Please select the tpc database.
You can see the list of tables that the lf-business-analyst user has access, and dl_tpc_sales_even is not one of them.
Run the following query:
SELECT*FROM"tpc"."dl_tpc_sales_event"limit10;
This query is going to show a sample of the data that is inside the table.
The last query tried to access the dl_tpc_sales_even table and as expected the business analyst user got an error message.