Skip to content
HomePT · EN · ES · JA · ZH

Query in Athena

Data Pump catalogs the result in the Glue Data Catalog. Any tool that reads the catalog — Athena, Redshift Spectrum, EMR, Spark — sees the tables.

The name comes from the database and the table, with the aliases you configured:

In the database In the data lake In Athena
pagila / public.payment pagila.payment pagila_payment
with aliases vendas / pagamentos vendas.pagamentos vendas_pagamentos

The public schema is removed; other schemas are preserved.

SELECT customer_id, sum(CAST(amount AS DECIMAL(10,2))) AS total
FROM datalake.vendas_pagamentos
WHERE ano = 2024 AND mes = 3
GROUP BY customer_id
ORDER BY total DESC
LIMIT 20;

The WHERE on the partition columns is what makes the difference in cost: without it, Athena reads the whole table.

The RDS export delivers several columns as text, including dates and decimal numbers. That comes from the format, not from Data Pump.

-- data
CAST(payment_date AS TIMESTAMP)
-- decimal
CAST(amount AS DECIMAL(10,2))

If a CAST is used every time, it is worth creating an extra column in the partition configuration: it is computed once, at ingestion, and arrives ready in Athena.

The console’s Datalake screen lists the cataloged tables with columns, types, row counts and the source of each one. It is faster than querying the catalog through Athena when you only want to know what is there.