Skip to content

Latest commit

 

History

History
109 lines (78 loc) · 2.17 KB

README.md

File metadata and controls

109 lines (78 loc) · 2.17 KB

Disclaimer

Esta configuração é puramente para fins de desenvolvimento local e estudos


Pré-requisitos?

  • Docker
  • Docker-Compose
  • Serviços Hadoop e Hive

Open DBeaver

New Database Connection - Apache Hive

Lab

Preencha as informações abaixo:

  • Hostname: localhost
  • Port:10000

Lab

Faça o Test Connection no botão inferior esquerdo

Lab

Abra um novo script conforme imagem abaixo

Lab

Criando database no Hive - raw_topics

create database if not exists raw_topics location 's3a://raw/topics'

Criando as External Tables

raw_topics.carrinho

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';

Rodar o repair para criar as partições

msck repair table raw_topics.carrinho;

select * from  raw_topics.carrinho;

raw_topics.produtos

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';

Rodar o repair para criar as partições

msck repair table raw_topics.produtos;

select * from  raw_topics.produtos;

raw_topics.compra

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';

Rodar o repair para criar as partições

msck repair table raw_topics.compra;

select * from  raw_topics.compra;

Rodar um select para testes:

select idproduto,count(*) as total from raw_topics.carrinho
group by  idproduto
order by 2 desc ;

Ir para o Proximo lab:

  1. Criando ambiente Analytics - Ingestão de Dados Externos com NIFI
  2. Analisando Dados com o metabase