像素
This commit is contained in:
parent
009d5f0560
commit
79b47321c5
@ -1 +1 @@
|
|||||||
create database zhengba;
|
create database xiangsu;
|
@ -8,7 +8,7 @@ class Config:
|
|||||||
'send_receive_timeout': 30}
|
'send_receive_timeout': 30}
|
||||||
|
|
||||||
# 每个游戏不一样 游戏上报 kafka 主题
|
# 每个游戏不一样 游戏上报 kafka 主题
|
||||||
SUBSCRIBE_TOPIC = 'zhengba_test'
|
SUBSCRIBE_TOPIC = 'xiangsu_test'
|
||||||
|
|
||||||
KAFKA_CONSUMER_CONF = {
|
KAFKA_CONSUMER_CONF = {
|
||||||
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
||||||
@ -18,14 +18,14 @@ class Config:
|
|||||||
'auto_commit_interval_ms': 10000,
|
'auto_commit_interval_ms': 10000,
|
||||||
|
|
||||||
# 每个游戏不一样
|
# 每个游戏不一样
|
||||||
'group_id': 'zhengba_consumer_group'
|
'group_id': 'xiangsu_consumer_group'
|
||||||
}
|
}
|
||||||
KAFKA_PRODUCER_CONF = {
|
KAFKA_PRODUCER_CONF = {
|
||||||
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
||||||
'value_serializer': lambda v: json.dumps(v).encode('utf-8'),
|
'value_serializer': lambda v: json.dumps(v).encode('utf-8'),
|
||||||
}
|
}
|
||||||
# 游戏数据库名
|
# 游戏数据库名
|
||||||
GAME = 'zhengba'
|
GAME = 'xiangsu'
|
||||||
|
|
||||||
STOP_SIGNAL = 'stop_MntxuXMc'
|
STOP_SIGNAL = 'stop_MntxuXMc'
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.user_view;
|
drop table if exists xiangsu.user_view;
|
||||||
create view zhengba.user_view as select *
|
create view xiangsu.user_view as select *
|
||||||
from zhengba.user
|
from xiangsu.user
|
||||||
order by `#reg_time` desc
|
order by `#reg_time` desc
|
||||||
LIMIT 1 by `#account_id`
|
LIMIT 1 by `#account_id`
|
6
充值视图.sql
6
充值视图.sql
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.recharge_game;
|
drop table if exists xiangsu.recharge_game;
|
||||||
create view zhengba.recharge_game as
|
create view xiangsu.recharge_game as
|
||||||
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
||||||
`#os`,
|
`#os`,
|
||||||
`#bundle_id`,
|
`#bundle_id`,
|
||||||
@ -8,6 +8,6 @@ select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
|||||||
arrayDistinct(groupArray(binduid)) as account,
|
arrayDistinct(groupArray(binduid)) as account,
|
||||||
length(account) as account_num,
|
length(account) as account_num,
|
||||||
sum(money) as money
|
sum(money) as money
|
||||||
from zhengba.event
|
from xiangsu.event
|
||||||
where `#event_name` = 'rechargeGame'
|
where `#event_name` = 'rechargeGame'
|
||||||
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.event;
|
drop table if exists xiangsu.event;
|
||||||
create table zhengba.event
|
create table xiangsu.event
|
||||||
(
|
(
|
||||||
`#ip` Nullable(IPv4),
|
`#ip` Nullable(IPv4),
|
||||||
`#country` Nullable(String),
|
`#country` Nullable(String),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.user;
|
drop table if exists xiangsu.user;
|
||||||
create table zhengba.user
|
create table xiangsu.user
|
||||||
(
|
(
|
||||||
|
|
||||||
`#reg_time` DateTime('UTC'),
|
`#reg_time` DateTime('UTC'),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.new_account;
|
drop table if exists xiangsu.new_account;
|
||||||
create view zhengba.new_account as
|
create view xiangsu.new_account as
|
||||||
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
||||||
`#os`,
|
`#os`,
|
||||||
`#bundle_id`,
|
`#bundle_id`,
|
||||||
@ -7,6 +7,6 @@ select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
|||||||
channel,
|
channel,
|
||||||
groupArray(`binduid`) as account,
|
groupArray(`binduid`) as account,
|
||||||
length(account) as num
|
length(account) as num
|
||||||
from zhengba.event
|
from xiangsu.event
|
||||||
where role_idx = 1
|
where role_idx = 1
|
||||||
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.new_account_recharge;
|
drop table if exists xiangsu.new_account_recharge;
|
||||||
create view zhengba.new_account_recharge as (select date,
|
create view xiangsu.new_account_recharge as (select date,
|
||||||
`#os`,
|
`#os`,
|
||||||
`#bundle_id`,
|
`#bundle_id`,
|
||||||
owner_name,
|
owner_name,
|
||||||
@ -13,11 +13,11 @@ from (select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
|||||||
channel,
|
channel,
|
||||||
binduid,
|
binduid,
|
||||||
money
|
money
|
||||||
from zhengba.event
|
from xiangsu.event
|
||||||
where `#event_name` = 'rechargeGame') as tb1
|
where `#event_name` = 'rechargeGame') as tb1
|
||||||
right join (select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
right join (select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
||||||
binduid
|
binduid
|
||||||
from zhengba.event
|
from xiangsu.event
|
||||||
where role_idx = 1) as tb2
|
where role_idx = 1) as tb2
|
||||||
on tb1.date = tb2.date and tb2.binduid = tb1.binduid
|
on tb1.date = tb2.date and tb2.binduid = tb1.binduid
|
||||||
group by date, `#os`, `#bundle_id`, owner_name, channel)
|
group by date, `#os`, `#bundle_id`, owner_name, channel)
|
@ -1,5 +1,5 @@
|
|||||||
drop table if exists zhengba.active_account;
|
drop table if exists xiangsu.active_account;
|
||||||
create view zhengba.active_account as
|
create view xiangsu.active_account as
|
||||||
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
||||||
`#os`,
|
`#os`,
|
||||||
`#bundle_id`,
|
`#bundle_id`,
|
||||||
@ -7,5 +7,5 @@ select toDate(addHours(`#event_time`, `#zone_offset`)) as date,
|
|||||||
channel,
|
channel,
|
||||||
uniqCombined(binduid) as num,
|
uniqCombined(binduid) as num,
|
||||||
arrayDistinct(groupArray(binduid)) as account
|
arrayDistinct(groupArray(binduid)) as account
|
||||||
from zhengba.event
|
from xiangsu.event
|
||||||
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
group by toDate(addHours(`#event_time`, `#zone_offset`)), `#os`, `#bundle_id`, owner_name, channel
|
Loading…
Reference in New Issue
Block a user