Esta configuração é puramente para fins de desenvolvimento local e estudos
- Docker
- Docker-Compose
- Serviços Hadoop e Hive
- Hostname: localhost
- Port:10000
create database if not exists raw_topics location 's3a://raw/topics'
create external table if not exists raw_topics.carrinho(
datacarrinho date, idproduto int, id int
)
PARTITIONED BY (ano string, mes string, dia string)
stored as jsonfile
location 's3a://raw/topics/carrinho';
msck repair table raw_topics.carrinho;
select * from raw_topics.carrinho;
create external table if not exists raw_topics.produtos (
id bigint,
nome string,
valor float
)
PARTITIONED BY (ano string, mes string, dia string)
stored as jsonfile
location 's3a://raw/topics/postgres.dbfiafastapi.produtos';
msck repair table raw_topics.produtos;
select * from raw_topics.produtos;
create external table if not exists raw_topics.compra(
id bigint,
valortotal float
)
PARTITIONED BY (ano string, mes string, dia string)
stored as jsonfile
location 's3a://raw/topics/postgres.dbfiafastapi.compra';
msck repair table raw_topics.compra;
select * from raw_topics.compra;
select idproduto,count(*) as total from raw_topics.carrinho
group by idproduto
order by 2 desc ;