├── data
└── .gitkeep
├── .gitignore
├── silver
├── gc
│ ├── tb_medalha.sql
│ ├── tb_players.sql
│ ├── tb_players_medalha.sql
│ └── tb_lobby_stats_player.sql
└── ingestao_stream.py
├── databases
└── create_databases.sql
├── bronze
├── schemas
│ ├── tb_medalha.json
│ ├── tb_players_medalha.json
│ ├── tb_players.json
│ └── tb_lobby_stats_player.json
└── ingestao.py
├── raw
├── full_load.py
├── incremental_lobby.py
└── incremental_lobby.sql
├── lib
└── gcutils
│ └── db.py
├── README.md
└── LICENSE
/data/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.db
2 | *.csv
--------------------------------------------------------------------------------
/silver/gc/tb_medalha.sql:
--------------------------------------------------------------------------------
1 | select
2 | Op,
3 | idMedal,
4 | descMedal,
5 | descTypeMedal
6 |
7 | from {table}
--------------------------------------------------------------------------------
/silver/gc/tb_players.sql:
--------------------------------------------------------------------------------
1 | select
2 | Op,
3 | idPlayer,
4 | flFacebook,
5 | flTwitter,
6 | flTwitch,
7 | descCountry,
8 | dtBirth,
9 | dtRegistration
10 |
11 | from {table}
--------------------------------------------------------------------------------
/databases/create_databases.sql:
--------------------------------------------------------------------------------
1 | -- Databricks notebook source
2 | CREATE SCHEMA IF NOT EXISTS bronze_gc LOCATION '/mnt/datalake/bronze/gc/';
3 | CREATE SCHEMA IF NOT EXISTS silver_gc LOCATION '/mnt/datalake/silver/gc/';
4 |
--------------------------------------------------------------------------------
/silver/gc/tb_players_medalha.sql:
--------------------------------------------------------------------------------
1 | select Op,
2 | id,
3 | idPlayer,
4 | idMedal,
5 | case when dtCreatedAt > dtRemove then dtRemove else dtCreatedAt end as dtCreatedAt,
6 | dtExpiration,
7 | dtRemove,
8 | flActive
9 |
10 | from {table}
--------------------------------------------------------------------------------
/bronze/schemas/tb_medalha.json:
--------------------------------------------------------------------------------
1 | {
2 | "fields": [
3 | {
4 | "metadata": {},
5 | "name": "idMedal",
6 | "nullable": true,
7 | "type": "integer"
8 | },
9 | {
10 | "metadata": {},
11 | "name": "descMedal",
12 | "nullable": true,
13 | "type": "string"
14 | },
15 | {
16 | "metadata": {},
17 | "name": "descTypeMedal",
18 | "nullable": true,
19 | "type": "string"
20 | }
21 | ],
22 | "type": "struct"
23 | }
--------------------------------------------------------------------------------
/raw/full_load.py:
--------------------------------------------------------------------------------
1 | # %%
2 |
3 | import boto3
4 | import pandas as pd
5 | import sqlalchemy
6 | from tqdm import tqdm
7 |
8 | def save_s3(table, db_con, s3_client):
9 | df = pd.read_sql(table, db_con)
10 | filename = f"../data/full_load/{table}.csv"
11 | df.to_csv(filename)
12 | s3_client.upload_file(filename, 'platform-datalake-teomewhy', f"raw/gc/full-load/{table}/full_load.csv")
13 | return True
14 |
15 | con = sqlalchemy.create_engine("sqlite:///../data/full_load/gc.db")
16 | tables = con.table_names()
17 | s3_client = boto3.client('s3')
18 |
19 | # %%
20 | for t in tqdm(tables):
21 | save_s3(t, con, s3_client)
--------------------------------------------------------------------------------
/lib/gcutils/db.py:
--------------------------------------------------------------------------------
1 | from pyspark.sql import types
2 |
3 | def import_query(path):
4 | with open(path, 'r') as open_file:
5 | query = open_file.read()
6 | return query
7 |
8 | def import_schema(table_name):
9 | with open(f'schemas/{table_name}.json', 'r') as open_file:
10 | schema = json.load(open_file)
11 | return types.StructType.fromJson(schema)
12 |
13 | def table_exists(database, table, spark):
14 | query = f'''show tables from {database} like '{table}' '''
15 | df = spark.sql(query)
16 | return df.count() > 0
17 |
18 | def etl(query, table, spark):
19 | query_format = query.format(table=table)
20 | df = spark.sql(query_format)
21 | return df
--------------------------------------------------------------------------------
/silver/gc/tb_lobby_stats_player.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | Op,
3 | idLobbyGame,
4 | idPlayer,
5 | idRoom,
6 | qtKill,
7 | qtAssist,
8 | qtDeath,
9 | qtHs,
10 | qtHs / qtKill as propHsRate,
11 | qtBombeDefuse,
12 | qtBombePlant,
13 | qtTk,
14 | qtTkAssist,
15 | qt1Kill,
16 | qt2Kill,
17 | qt3Kill,
18 | qt4Kill,
19 | qt5Kill,
20 | qtPlusKill,
21 | qtFirstKill,
22 | vlDamage,
23 | qtHits,
24 | qtShots,
25 | qtLastAlive,
26 | qtClutchWon,
27 | qtRoundsPlayed,
28 | descMapName,
29 | vlLevel,
30 | qtSurvived,
31 | qtTrade,
32 | qtFlashAssist,
33 | qtHitHeadshot,
34 | qtHitChest,
35 | qtHitStomach,
36 | qtHitLeftAtm,
37 | qtHitRightArm,
38 | qtHitLeftLeg,
39 | qtHitRightLeg,
40 | flWinner,
41 | dtCreatedAt
42 |
43 | from {table}
--------------------------------------------------------------------------------
/raw/incremental_lobby.py:
--------------------------------------------------------------------------------
1 |
2 | # %%
3 | import argparse
4 | import os
5 |
6 | import boto3
7 | import pandas as pd
8 | import sqlalchemy
9 |
10 |
11 | if not os.path.exists('../data/incremental/tb_lobby_stats_player/'):
12 | os.mkdir('../data/incremental/tb_lobby_stats_player/')
13 |
14 | parser = argparse.ArgumentParser()
15 | parser.add_argument("--nPlayers", "-n", default=100)
16 | args = parser.parse_args()
17 |
18 | con = sqlalchemy.create_engine("sqlite:///../data/incremental/gc_incremental.db")
19 | s3_client = boto3.client('s3')
20 |
21 | with open("incremental_lobby.sql", 'r') as open_file:
22 | query = open_file.read()
23 |
24 | query = query.format(nPlayers=args.nPlayers)
25 |
26 | df = pd.read_sql(query, con)
27 |
28 | last_id = df['idLobbyGame'].min()
29 | filename = f"../data/incremental/tb_lobby_stats_player/{last_id}.csv"
30 | df.to_sql("tb_lobby_stats_player", con, if_exists='append', index=False)
31 |
32 | df['Op'] = 'I' # I = Insert; D = Delete ; U = Update
33 | df.to_csv(filename, index=False)
34 | s3_client.upload_file(filename, 'platform-datalake-teomewhy', f"raw/gc/cdc/tb_lobby_stats_player/{last_id}.csv")
--------------------------------------------------------------------------------
/bronze/schemas/tb_players_medalha.json:
--------------------------------------------------------------------------------
1 | {
2 | "fields": [
3 | {
4 | "metadata": {},
5 | "name": "id",
6 | "nullable": true,
7 | "type": "integer"
8 | },
9 | {
10 | "metadata": {},
11 | "name": "idPlayer",
12 | "nullable": true,
13 | "type": "integer"
14 | },
15 | {
16 | "metadata": {},
17 | "name": "idMedal",
18 | "nullable": true,
19 | "type": "integer"
20 | },
21 | {
22 | "metadata": {},
23 | "name": "dtCreatedAt",
24 | "nullable": true,
25 | "type": "date"
26 | },
27 | {
28 | "metadata": {},
29 | "name": "dtExpiration",
30 | "nullable": true,
31 | "type": "date"
32 | },
33 | {
34 | "metadata": {},
35 | "name": "dtRemove",
36 | "nullable": true,
37 | "type": "date"
38 | },
39 | {
40 | "metadata": {},
41 | "name": "flActive",
42 | "nullable": true,
43 | "type": "integer"
44 | }
45 | ],
46 | "type": "struct"
47 | }
--------------------------------------------------------------------------------
/bronze/schemas/tb_players.json:
--------------------------------------------------------------------------------
1 | {
2 | "fields": [
3 | {
4 | "metadata": {},
5 | "name": "idPlayer",
6 | "nullable": true,
7 | "type": "string"
8 | },
9 | {
10 | "metadata": {},
11 | "name": "flFacebook",
12 | "nullable": true,
13 | "type": "string"
14 | },
15 | {
16 | "metadata": {},
17 | "name": "flTwitter",
18 | "nullable": true,
19 | "type": "string"
20 | },
21 | {
22 | "metadata": {},
23 | "name": "flTwitch",
24 | "nullable": true,
25 | "type": "string"
26 | },
27 | {
28 | "metadata": {},
29 | "name": "descCountry",
30 | "nullable": true,
31 | "type": "string"
32 | },
33 | {
34 | "metadata": {},
35 | "name": "dtBirth",
36 | "nullable": true,
37 | "type": "timestamp"
38 | },
39 | {
40 | "metadata": {},
41 | "name": "dtRegistration",
42 | "nullable": true,
43 | "type": "timestamp"
44 | }
45 | ],
46 | "type": "struct"
47 | }
--------------------------------------------------------------------------------
/raw/incremental_lobby.sql:
--------------------------------------------------------------------------------
1 | with tb_player as (
2 |
3 | select distinct idPlayer
4 | from tb_lobby_stats_player
5 |
6 | ),
7 |
8 | tb_random_players as (
9 |
10 | select idPlayer,
11 | abs(1.0 * random() % 10000) as randRank
12 | from tb_player
13 |
14 | ),
15 |
16 | tb_selected_player as (
17 |
18 | select *
19 | from tb_random_players
20 | order by randRank desc, idPlayer desc
21 | limit {nPlayers}
22 |
23 | ),
24 |
25 | tb_random_lobby as (
26 |
27 | select t1.*,
28 | t2.*,
29 | row_number() over (partition by t1.idPlayer order by random()) as rankLobby
30 |
31 | from tb_selected_player as t1
32 | left join tb_lobby_stats_player as t2
33 | on t1.idPlayer = t2.idPlayer
34 |
35 | )
36 |
37 | select
38 | idLobbyGame + (select max(idLobbyGame) from tb_lobby_stats_player) as idLobbyGame,
39 | idPlayer,
40 | idRoom,
41 | qtKill,
42 | qtAssist,
43 | qtDeath,
44 | qtHs,
45 | qtBombeDefuse,
46 | qtBombePlant,
47 | qtTk,
48 | qtTkAssist,
49 | qt1Kill,
50 | qt2Kill,
51 | qt3Kill,
52 | qt4Kill,
53 | qt5Kill,
54 | qtPlusKill,
55 | qtFirstKill,
56 | vlDamage,
57 | qtHits,
58 | qtShots,
59 | qtLastAlive,
60 | qtClutchWon,
61 | qtRoundsPlayed,
62 | descMapName,
63 | vlLevel,
64 | qtSurvived,
65 | qtTrade,
66 | qtFlashAssist,
67 | qtHitHeadshot,
68 | qtHitChest,
69 | qtHitStomach,
70 | qtHitLeftAtm,
71 | qtHitRightArm,
72 | qtHitLeftLeg,
73 | qtHitRightLeg,
74 | flWinner,
75 | datetime((select max(dtCreatedAt) from tb_lobby_stats_player), '+1 day') as dtCreatedAt
76 |
77 | from tb_random_lobby
78 | where rankLobby = 1
--------------------------------------------------------------------------------
/bronze/ingestao.py:
--------------------------------------------------------------------------------
1 | # Databricks notebook source
2 | # DBTITLE 1,Imports
3 | from pyspark.sql import types
4 | from pyspark.sql import functions as F
5 | from pyspark.sql import window
6 |
7 | from delta.tables import *
8 |
9 | import json
10 | import time
11 |
12 | def import_schema(table_name):
13 | with open(f'schemas/{table_name}.json', 'r') as open_file:
14 | schema = json.load(open_file)
15 | return types.StructType.fromJson(schema)
16 |
17 | def table_exists(database, table):
18 | query = f'''show tables from {database} like '{table}' '''
19 | df = spark.sql(query)
20 | return df.count() > 0
21 |
22 |
23 | # COMMAND ----------
24 |
25 | # DBTITLE 1,Setup do job
26 | table_name = dbutils.widgets.get("table")
27 | id_field = dbutils.widgets.get("id_field").split(",")
28 | strongly_date = dbutils.widgets.get("strongly_date")
29 |
30 | full_load_path = f'/mnt/datalake/raw/gc/full-load/{table_name}'
31 | cdc_path = f'/mnt/datalake/raw/gc/cdc/{table_name}'
32 |
33 | table_schema = import_schema(table_name)
34 |
35 | checkpoint_path = f'/mnt/datalake/bronze/gc/{table_name}_checkpoint'
36 |
37 | stream_schema = table_schema[:]
38 | stream_schema = stream_schema.add('Op', data_type=types.StringType(), nullable=False, metadata={})
39 |
40 | # COMMAND ----------
41 |
42 | # DBTITLE 1,Carga full-load
43 | if not table_exists("bronze_gc", table_name):
44 | print("Realizando a primeira carga...")
45 | df = spark.read.schema(table_schema).csv(full_load_path, header=True)
46 | df.write.format('delta').saveAsTable(f'bronze_gc.{table_name}')
47 | print("ok.")
48 |
49 | # COMMAND ----------
50 |
51 | # DBTITLE 1,Stream para CDC
52 | def upsert_delta(df, batchId, delta_table, id_field, strongly_date):
53 |
54 | join = " and ".join([f'd.{i} = c.{i}' for i in id_field])
55 |
56 | w = window.Window.partitionBy(*id_field).orderBy(F.desc(strongly_date))
57 | cdc_data = (df.withColumn('rn', F.row_number().over(w))
58 | .filter('rn=1')
59 | .drop(F.col('rn')))
60 |
61 | (delta_table.alias("d")
62 | .merge(cdc_data.alias("c"), join)
63 | .whenMatchedDelete(condition = "c.Op = 'D'")
64 | .whenMatchedUpdateAll(condition = "c.Op ='U'")
65 | .whenNotMatchedInsertAll(condition = "c.Op = 'I'")
66 | .execute())
67 |
68 | return None
69 |
70 | delta_table = DeltaTable.forName(spark, f"bronze_gc.{table_name}")
71 |
72 | df_stream = (spark.readStream
73 | .format('cloudFiles')
74 | .option('cloudFiles.format', 'csv')
75 | .option('header', 'true')
76 | .schema(stream_schema)
77 | .load(cdc_path))
78 |
79 | stream = (df_stream.writeStream
80 | .format('delta')
81 | .foreachBatch(lambda df, batchId: upsert_delta(df, batchId, delta_table, id_field, strongly_date))
82 | .option('checkpointLocation', checkpoint_path)
83 | .start())
84 |
85 | # COMMAND ----------
86 |
87 | time.sleep(60*5)
88 | stream.processAllAvailable()
89 | stream.stop()
90 |
--------------------------------------------------------------------------------
/silver/ingestao_stream.py:
--------------------------------------------------------------------------------
1 | # Databricks notebook source
2 | import time
3 |
4 | from pyspark.sql import functions as F
5 | from pyspark.sql import window
6 |
7 | from delta.tables import *
8 |
9 | import sys
10 |
11 | sys.path.insert(0, '../lib')
12 |
13 | from gcutils import db
14 |
15 | # COMMAND ----------
16 |
17 | # DBTITLE 1,Parâmetros
18 | tb_origin = dbutils.widgets.get('tb_origin')
19 | tb_target = dbutils.widgets.get('tb_target')
20 |
21 | id_origin = dbutils.widgets.get('id_origin').split(",")
22 | id_target = dbutils.widgets.get('id_target').split(",")
23 |
24 | strongly_date_origin = dbutils.widgets.get('strongly_date_origin')
25 | strongly_date_target = dbutils.widgets.get('strongly_date_target')
26 |
27 | checkpoint_path = f'/mnt/datalake/silver/gc/{tb_target.split(".")[-1]}_checkpoint'
28 | table = tb_target.split(".")[-1]
29 | database = "_".join(tb_target.split(".")[0].split("_")[1:])
30 |
31 | # COMMAND ----------
32 |
33 | # DBTITLE 1,Full load
34 | query = db.import_query(f'{database}/{table}.sql')
35 |
36 | if not db.table_exists(*tb_target.split('.'), spark):
37 | query_exec = query.replace(" Op,", "")
38 | print("Realizando a primeira carga...")
39 | df = db.etl(query_exec, tb_origin, spark)
40 | df.coalesce(1).write.mode('overwrite').format('delta').saveAsTable(tb_target)
41 | print("ok.")
42 |
43 | # COMMAND ----------
44 |
45 | # DBTITLE 1,Stream
46 | delta_table = DeltaTable.forName(spark, tb_target)
47 |
48 | def upsert_delta(df, batchId, query, delta_table, id_field, strongly_date):
49 |
50 | join = " and ".join([f'd.{i} = c.{i}' for i in id_field])
51 |
52 | w = window.Window.partitionBy(*id_field).orderBy(F.desc(strongly_date))
53 |
54 | df =(df.withColumn("Op", F.when(df._change_type == "insert","I")
55 | .when(df._change_type == "update_preimage", "U")
56 | .when(df._change_type == "update_postimage", "U")
57 | .when(df._change_type == 'delete' ,"D"))
58 | .withColumn('rn', F.row_number().over(w))
59 | .filter('rn=1')
60 | .drop(F.col('rn')))
61 |
62 | view_name = f'{tb_target.split(".")[-1]}_view'
63 | df.createOrReplaceGlobalTempView(view_name)
64 |
65 | view_name = f'global_temp.{tb_target.split(".")[-1]}_view'
66 | cdc_data = db.etl(query, view_name, spark)
67 |
68 | (delta_table.alias("d")
69 | .merge(cdc_data.alias("c"), join)
70 | .whenMatchedDelete(condition = "c.Op = 'D'")
71 | .whenMatchedUpdateAll(condition = "c.Op ='U'")
72 | .whenNotMatchedInsertAll(condition = "c.Op = 'I'")
73 | .execute())
74 | return None
75 |
76 | df_stream = (spark.readStream
77 | .format("delta")
78 | .option("readChangeFeed", "true")
79 | .option("startingVersion", 0)
80 | .table(tb_origin))
81 |
82 | stream = (df_stream.writeStream
83 | .format('delta')
84 | .foreachBatch(lambda df, batchId: upsert_delta(df, batchId, query, delta_table, id_target, strongly_date_target))
85 | .option('checkpointLocation', checkpoint_path)
86 | .start())
87 |
88 | # COMMAND ----------
89 |
90 | time.sleep(60)
91 | stream.processAllAvailable()
92 | stream.stop()
93 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # gc-bricks
2 |
3 | Aprendendo sobre Datalakes com dados de [Counter Strike](https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/) da [Gamers Club (GC)](https://gamersclub.gg/).
4 |
5 | Lives na [Twitch](https://www.twitch.tv/teomewhy) todas terças e quintas às 9:00AM!
6 |
7 |
8 | [
](https://www.twitch.tv/teomewhy) [
](https://gamersclub.gg/) [
](https://spark.apache.org/) [
](https://delta.io/) [
](https://databricks.com/)
9 |
10 | ## Sumário
11 |
12 | * [1. Sobre o projeto](#sobre-o-projeto)
13 |
14 | * [2 Ferramentas utilizadas](#ferramentas-utilizadas)
15 |
16 | * [3 Sobre os dados](#sobre-os-dados)
17 |
18 | * [4 Sobre o autor](#sobre-o-autor)
19 |
20 | * [5 Como apoiar](#como-apoiar)
21 |
22 | ## Sobre o projeto
23 |
24 | A ideia principal deste projeto é a criação de um Datalake utilizando os dados públicos que a Gamers Clube disponibilizou no Kaggle. É esperado que os exemplos construidos auxiliem os primeiros passos de quem se interesse pelo tema. Assim, começaremos do básico e evoluiremos em conjuto com a comunidade.
25 |
26 | Todo conteúdo será realizado em lives na Twitch no canal [Téo Me Why](https://www.twitch.tv/teomewhy). Não há custo algum para assistir às lives nem mesmo cadastro é necessário. Mas para ter uma melhor experiência, o cadastro na Twitch te possibilita maiores iterações. Para ter acesso ao conteúdo gravado, é necessário ser assinante do canal.
27 |
28 | Realizaremos as primeiras ingestões de dados na camada `raw`, consolidação em DeltaLake para camada `bronze`, qualidade de dados e padronizações em `silver` e visões analíticas em `gold`. Assim, construiremos pipelines de dados end-to-end.
29 |
30 | Você pode conferir o andamento do nosso projeto por meio das [`issues`](https://github.com/TeoMeWhy/gc-bricks/issues) e também pelo [painel de nosso projeto](https://github.com/orgs/TeoMeWhy/projects/1).
31 |
32 | ## Ferramentas Utilizadas
33 |
34 | Para a construção deste projeto contaremos com os seguintes componentes:
35 | 1. AWS S3 - Storage de armazenamentos dos dados. É onde todos os nossos dados serão guardados, seja em arquivos `.csv`, `.parquet` ou `.json`.
36 | 2. Apache Spark - Motor de processamento de dados. Esse cara que realizará todo processamento dos nossos dados e levando ele para camadas mais trabalhadas. Bem como nosso facilitador para realizar consultas em nossos dados para gerar indights, análises, modelos preditivos, etc.
37 | 3. Delta Lake - Framework de estrutura de arquivos e pastas para criação de Lakehouses. Com isso, temos a possibilidade de ter operações de `UPDATE` e `DELETE` em nosso Datalake, simulando um ambiente análogo ao de DataWarehouse (chamado datalakehouse).
38 | 4. Databricks - SaaS para Big Data. Este componente provisiona clusters Apache Spark auto geridos, bem como todas features de Delta Lake para criação de nosso projeto. Além de funcionalidades adicionais que facilitam nosso trabalho, como: orquestrador de execução, ambiente de desenvolvimento em notebooks, versionamento de código, trabalho compartilhado e outros.
39 | 5. Redash - Ferramenta para Data Visualization - É importante fornecer na ponta os resultados obtidos para os tomadores de decisão, assim, escolhemos o Redash para ser nossa ferramenta de Dashboards.
40 |
41 | ## Sobre os dados
42 |
43 | Vamos utilizar os dados da Gamers Club para realizar todos os passos. Você pode encontrar os dados disponíveis no [Kaggle](https://www.kaggle.com/gamersclub/brazilian-csgo-plataform-dataset-by-gamers-club), em formato `.csv`.
44 |
45 | Estes dados representam uma pequena parcela dos serviços disponíveis na plataforma da Gamers Club. Abaixo temos as tabelas contidas no dataset:
46 |
47 | - tb_lobby_stats_player: Tabela com estatísticas das Lobbies (partidas) de cada player. São mais de 150.000 linhas de dados
48 | - tb_medalha: Tabela com a descrições das medalhas disponíveis na GC e seu tipo. São mais de 40 linhas com medalhas distintas.
49 | - tb_players: Tabela com informações cadastrais dos players amostrados. São mais de 2.500 players distintos.
50 | - tb_players_medalha: Tabela com informações das medalhas que cada player adquiriu e expiração. São mais de 32.000 linhas.
51 |
52 | Temos ainda um esquema do relacionamento destes dados:
53 |
54 |
55 |
56 | ## Sobre o autor
57 |
58 | Téo é Bacharel em Estatística e tem Pós Graduação em Data Science & Big Data.
59 |
60 | Hoje, como Head of Data na Gamers Club, gostaria de contribuir ainda mais para a comunidade trazendo dados reais e aplicações com SQL, Python e Machine Learning.
61 |
62 | Você pode conhecer mais sobre mim no [LinkedIn](https://www.linkedin.com/in/teocalvo/) e [GitHub](https://github.com/teocalvo).
63 |
64 | ## Como apoiar
65 |
66 | O Téo Me Why existe a partir do propósito de mudar vidas pelo ensino, assim, a melhor forma de apoiar o que estamos construindo é o compartilhamento e interações nas redes sociais. Talvez você não faça ideia o quanto sua curtida pode alcançar e transformar vidas.
67 |
68 | Para manter o ambiente que construiremos funcionando, existe um custo envolvido. Hoje, as assinaturas da Twitch são a principal forma que conseguimos deixar as contas equilibradas. Assim, você pode nos apoiar assinano nosso canal. Em troca da assinatura, você terá acesso à todo material criado na Twitch, e ficará livre dos ADs (propaganda) durante as transmissões.
69 |
70 | Prezamos pela transparência, assim, você pode conferir nossas [contas aqui](https://docs.google.com/spreadsheets/d/1V5e4aIJTLh1k7kFn_wj5Bn_7_9hDCml1eNcXdK6NhU8/edit?usp=sharing).
71 |
72 | Fique a vontade para contribuir com este documento, corrigindo erros de português e digitação. Bem como abertura de `issues` que acredita ser interessante resolvermos.
73 |
--------------------------------------------------------------------------------
/bronze/schemas/tb_lobby_stats_player.json:
--------------------------------------------------------------------------------
1 | {
2 | "fields": [
3 |
4 | {
5 | "metadata": {},
6 | "name": "idLobbyGame",
7 | "nullable": true,
8 | "type": "integer"
9 | },
10 | {
11 | "metadata": {},
12 | "name": "idPlayer",
13 | "nullable": true,
14 | "type": "integer"
15 | },
16 | {
17 | "metadata": {},
18 | "name": "idRoom",
19 | "nullable": true,
20 | "type": "integer"
21 | },
22 | {
23 | "metadata": {},
24 | "name": "qtKill",
25 | "nullable": true,
26 | "type": "integer"
27 | },
28 | {
29 | "metadata": {},
30 | "name": "qtAssist",
31 | "nullable": true,
32 | "type": "integer"
33 | },
34 | {
35 | "metadata": {},
36 | "name": "qtDeath",
37 | "nullable": true,
38 | "type": "integer"
39 | },
40 | {
41 | "metadata": {},
42 | "name": "qtHs",
43 | "nullable": true,
44 | "type": "integer"
45 | },
46 | {
47 | "metadata": {},
48 | "name": "qtBombeDefuse",
49 | "nullable": true,
50 | "type": "integer"
51 | },
52 | {
53 | "metadata": {},
54 | "name": "qtBombePlant",
55 | "nullable": true,
56 | "type": "integer"
57 | },
58 | {
59 | "metadata": {},
60 | "name": "qtTk",
61 | "nullable": true,
62 | "type": "float"
63 | },
64 | {
65 | "metadata": {},
66 | "name": "qtTkAssist",
67 | "nullable": true,
68 | "type": "float"
69 | },
70 | {
71 | "metadata": {},
72 | "name": "qt1Kill",
73 | "nullable": true,
74 | "type": "integer"
75 | },
76 | {
77 | "metadata": {},
78 | "name": "qt2Kill",
79 | "nullable": true,
80 | "type": "integer"
81 | },
82 | {
83 | "metadata": {},
84 | "name": "qt3Kill",
85 | "nullable": true,
86 | "type": "integer"
87 | },
88 | {
89 | "metadata": {},
90 | "name": "qt4Kill",
91 | "nullable": true,
92 | "type": "integer"
93 | },
94 | {
95 | "metadata": {},
96 | "name": "qt5Kill",
97 | "nullable": true,
98 | "type": "integer"
99 | },
100 | {
101 | "metadata": {},
102 | "name": "qtPlusKill",
103 | "nullable": true,
104 | "type": "integer"
105 | },
106 | {
107 | "metadata": {},
108 | "name": "qtFirstKill",
109 | "nullable": true,
110 | "type": "integer"
111 | },
112 | {
113 | "metadata": {},
114 | "name": "vlDamage",
115 | "nullable": true,
116 | "type": "float"
117 | },
118 | {
119 | "metadata": {},
120 | "name": "qtHits",
121 | "nullable": true,
122 | "type": "float"
123 | },
124 | {
125 | "metadata": {},
126 | "name": "qtShots",
127 | "nullable": true,
128 | "type": "float"
129 | },
130 | {
131 | "metadata": {},
132 | "name": "qtLastAlive",
133 | "nullable": true,
134 | "type": "float"
135 | },
136 | {
137 | "metadata": {},
138 | "name": "qtClutchWon",
139 | "nullable": true,
140 | "type": "float"
141 | },
142 | {
143 | "metadata": {},
144 | "name": "qtRoundsPlayed",
145 | "nullable": true,
146 | "type": "float"
147 | },
148 | {
149 | "metadata": {},
150 | "name": "descMapName",
151 | "nullable": true,
152 | "type": "string"
153 | },
154 | {
155 | "metadata": {},
156 | "name": "vlLevel",
157 | "nullable": true,
158 | "type": "float"
159 | },
160 | {
161 | "metadata": {},
162 | "name": "qtSurvived",
163 | "nullable": true,
164 | "type": "float"
165 | },
166 | {
167 | "metadata": {},
168 | "name": "qtTrade",
169 | "nullable": true,
170 | "type": "float"
171 | },
172 | {
173 | "metadata": {},
174 | "name": "qtFlashAssist",
175 | "nullable": true,
176 | "type": "float"
177 | },
178 | {
179 | "metadata": {},
180 | "name": "qtHitHeadshot",
181 | "nullable": true,
182 | "type": "float"
183 | },
184 | {
185 | "metadata": {},
186 | "name": "qtHitChest",
187 | "nullable": true,
188 | "type": "float"
189 | },
190 | {
191 | "metadata": {},
192 | "name": "qtHitStomach",
193 | "nullable": true,
194 | "type": "float"
195 | },
196 | {
197 | "metadata": {},
198 | "name": "qtHitLeftAtm",
199 | "nullable": true,
200 | "type": "float"
201 | },
202 | {
203 | "metadata": {},
204 | "name": "qtHitRightArm",
205 | "nullable": true,
206 | "type": "float"
207 | },
208 | {
209 | "metadata": {},
210 | "name": "qtHitLeftLeg",
211 | "nullable": true,
212 | "type": "float"
213 | },
214 | {
215 | "metadata": {},
216 | "name": "qtHitRightLeg",
217 | "nullable": true,
218 | "type": "float"
219 | },
220 | {
221 | "metadata": {},
222 | "name": "flWinner",
223 | "nullable": true,
224 | "type": "integer"
225 | },
226 | {
227 | "metadata": {},
228 | "name": "dtCreatedAt",
229 | "nullable": true,
230 | "type": "timestamp"
231 | }
232 | ],
233 | "type": "struct"
234 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------