Commit 106ded3a authored by 赵建伟's avatar 赵建伟

Merge branch 'weiyimin' into 'master'

Weiyimin

See merge request !13
parents a6e3fda4 3f7b9d6d
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="UTF-8" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="NESTED TABLE" enabled="false" />
<object-type name="COLUMN" enabled="false" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE ATTRIBUTE" enabled="false" />
<object-type name="ARGUMENT" enabled="false" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<tracking-columns>
<columnNames value="" />
<visible value="true" />
<editable value="false" />
</tracking-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
</project>
\ No newline at end of file
...@@ -614,7 +614,7 @@ LEFT JOIN ...@@ -614,7 +614,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','') AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home' AND page_name = 'home'
AND action = 'on_click_card' AND action = 'on_click_card'
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata') AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article') AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article')
UNION ALL UNION ALL
...@@ -626,7 +626,7 @@ LEFT JOIN ...@@ -626,7 +626,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','') AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home' AND page_name = 'home'
AND action in ( 'on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card') AND action in ( 'on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card')
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata') AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
UNION ALL UNION ALL
...@@ -637,7 +637,7 @@ LEFT JOIN ...@@ -637,7 +637,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','') AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home' AND page_name = 'home'
AND action = 'on_click_card' AND action = 'on_click_card'
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata') AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article') AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article')
UNION ALL UNION ALL
...@@ -649,7 +649,7 @@ LEFT JOIN ...@@ -649,7 +649,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','') AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home' AND page_name = 'home'
AND action in ('on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card') AND action in ('on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card')
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata') AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
)t2 )t2
ON t1.partition_date=t2.partition_date ON t1.partition_date=t2.partition_date
AND t1.device_id=t2.cl_id AND t1.device_id=t2.cl_id
......
#step3.job #step3.job
type=command type=command
dependencies=step2 dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/daily_content_data/liudi@igengmei.com,wangxin@igengmei.com,malinxi@igengmei.com,dengguangyu@igengmei.com/weiyimin@igengmei.com,zhaojianwei@igengmei.com,zhaofei@igengmei.com,yindanlei@igengmei.com command=curl -X GET http://localhost:8553/api/report/email/daily_content_data/liudi@igengmei.com,wangxin@igengmei.com,dengguangyu@igengmei.com/weiyimin@igengmei.com,zhaofei@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file \ No newline at end of file
daily_push=push日报-策略方向
daily_push_click=push拉起设备数据
personal_push_received=push接收设备数据
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: push日报
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d
(
day_id string comment '{"chs_name":"当天日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}',
dau BIGINT comment '{"chs_name":"DAU","description":"","etl":"","value":"","remark":""}',
is_open_uv BIGINT comment '{"chs_name":"push开启设备数","description":"","etl":"","value":"","remark":""}',
push_open_uv BIGINT comment '{"chs_name":"push拉起设备数","description":"","etl":"","value":"","remark":""}',
push_open_pv BIGINT comment '{"chs_name":"push拉起人次","description":"","etl":"","value":"","remark":""}',
push_open_2_uv BIGINT comment '{"chs_name":"push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
push_open_2_pv BIGINT comment '{"chs_name":"push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
op_push_open_uv BIGINT comment '{"chs_name":"运营push拉起设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_pv BIGINT comment '{"chs_name":"运营push拉起人次","description":"","etl":"","value":"","remark":""}',
op_push_open_2_uv BIGINT comment '{"chs_name":"运营push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_2_pv BIGINT comment '{"chs_name":"运营push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
will_push_open_uv BIGINT comment '{"chs_name":"意愿探索push拉起设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_pv BIGINT comment '{"chs_name":"意愿探索push拉起人次","description":"","etl":"","value":"","remark":""}',
will_push_open_2_uv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_2_pv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_uv BIGINT comment '{"chs_name":"签到push拉起设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_pv BIGINT comment '{"chs_name":"签到push拉起人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_uv BIGINT comment '{"chs_name":"签到push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_pv BIGINT comment '{"chs_name":"签到push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_uv BIGINT comment '{"chs_name":"个性化push拉起设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_pv BIGINT comment '{"chs_name":"个性化push拉起人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_uv BIGINT comment '{"chs_name":"个性化push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_pv BIGINT comment '{"chs_name":"个性化push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_uv BIGINT comment '{"chs_name":"ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_pv BIGINT comment '{"chs_name":"ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_uv BIGINT comment '{"chs_name":"ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_pv BIGINT comment '{"chs_name":"ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_uv BIGINT comment '{"chs_name":"非ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_pv BIGINT comment '{"chs_name":"非ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_uv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_pv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_uv BIGINT comment '{"chs_name":"AI_push拉起设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_pv BIGINT comment '{"chs_name":"AI_push拉起人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_uv BIGINT comment '{"chs_name":"AI_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_pv BIGINT comment '{"chs_name":"AI_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_uv BIGINT comment '{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_pv BIGINT comment '{"chs_name":"除运营外push拉起人次","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}'
)comment 'push日报'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: push接收数据
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_push_receive_d
(
day_id string comment '{"chs_name":"当天日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}',
push_type BIGINT comment '{"chs_name":"push类型","description":"","etl":"","value":"","remark":""}',
received_dev_num BIGINT comment '{"chs_name":"push接收设备数","description":"","etl":"","value":"","remark":""}',
received_msg_num BIGINT comment '{"chs_name":"push接收消息数","description":"","etl":"","value":"","remark":""}',
click_dev_num BIGINT comment '{"chs_name":"push点击设备数","description":"","etl":"","value":"","remark":""}',
click_msg_num BIGINT comment '{"chs_name":"push点击消息数","description":"","etl":"","value":"","remark":""}'
)comment 'push接收数据'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
\ No newline at end of file
SET mapreduce.job.queuename=data;
SET mapreduce.map.memory.mb=8192;
SET mapreduce.map.java.opts=-Xmx8000m;
SET mapreduce.reduce.memory.mb=8192;
SET mapreduce.reduce.java.opts=-Xmx8000m;
set hive.auto.convert.join=true;
SET mapred.reduce.tasks=20;
SET role admin;
--push点击数据
INSERT OVERWRITE TABLE pm.tl_pm_push_click_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT t1.partition_date as day_id
,device_os_type
,active_type
,count(distinct t1.device_id) as dau
,count(distinct is_open.cl_id) as is_open_uv --push开启设备数
,count(distinct t2.cl_id) as push_open_uv --push拉起设备数
,sum(NVL(t2.push_open_pv,0)) as push_open_pv --push拉起人次
,count(distinct t5.cl_id) as push_open_2_uv --push拉起有2跳设备数
,sum(case WHEN t5.cl_id is not null then push_open_2_pv END) as push_open_2_pv --push拉起有2跳人次
,count(distinct case when op_push_open_pv is not null and op_push_open_pv>0 then t2.cl_id end) as op_push_open_uv --运营push拉起设备数
,sum(NVL(t2.op_push_open_pv,0)) as op_push_open_pv --运营push拉起人次
,count(distinct case when op_push_open_2_pv is not null and op_push_open_2_pv>0 then t5.cl_id end) as op_push_open_2_uv --运营push拉起有2跳设备数
,sum(NVL(t5.op_push_open_2_pv,0)) as op_push_open_2_pv --运营push拉起有2跳人次
,count(distinct case when auto_push_open_pv is not null and auto_push_open_pv>0 then t2.cl_id end) as auto_push_open_uv --自动push拉起设备数
,sum(NVL(t2.auto_push_open_pv,0)) as auto_push_open_pv --自动push拉起人次
,count(distinct case when auto_push_open_2_pv is not null and auto_push_open_2_pv>0 then t5.cl_id end) as auto_push_open_2_uv --自动push拉起有2跳设备数
,sum(NVL(t5.auto_push_open_2_pv,0)) as auto_push_open_2_pv --自动push拉起有2跳人次
,count(distinct case when will_push_open_pv is not null and will_push_open_pv>0 then t2.cl_id end) as will_push_open_uv --意愿探索push拉起设备数
,sum(NVL(t2.will_push_open_pv,0)) as will_push_open_pv --意愿探索push拉起人次
,count(distinct case when will_push_open_2_pv is not null and will_push_open_2_pv>0 then t5.cl_id end) as will_push_open_2_uv --意愿探索push拉起有2跳设备数
,sum(NVL(t5.will_push_open_2_pv,0)) as will_push_open_2_pv
,count(distinct case when sign_push_open_pv is not null and sign_push_open_pv>0 then t2.cl_id end) as sign_push_open_uv --签到push拉起设备数
,sum(NVL(t2.sign_push_open_pv,0)) as sign_push_open_pv --签到push拉起人次
,count(distinct case when sign_push_open_2_pv is not null and sign_push_open_2_pv>0 then t5.cl_id end) as sign_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.sign_push_open_2_pv,0)) as sign_push_open_2_pv
,count(distinct case when t2.ctr_push_open_pv+t2.non_ctr_push_open_pv+t2.will_push_open_pv>0 then t2.cl_id end) as personal_push_open_uv --个性化push拉起设备数
,sum(NVL(t2.ctr_push_open_pv+t2.non_ctr_push_open_pv+t2.will_push_open_pv,0)) as personal_push_open_pv --个性化push拉起人次
,count(distinct case when t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv+t5.will_push_open_2_pv>0 then t5.cl_id end) as personal_push_open_2_uv --个性化push拉起设备数
,sum(NVL(t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv+t5.will_push_open_2_pv,0)) as personal_push_open_2_pv --个性化push拉起有2跳人次
,count(distinct case when ctr_push_open_pv is not null and ctr_push_open_pv>0 then t2.cl_id end) as ctr_push_open_uv --签到push拉起设备数
,sum(NVL(t2.ctr_push_open_pv,0)) as ctr_push_open_pv --签到push拉起人次
,count(distinct case when ctr_push_open_2_pv is not null and ctr_push_open_2_pv>0 then t5.cl_id end) as ctr_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.ctr_push_open_2_pv,0)) as ctr_push_open_2_pv
,count(distinct case when non_ctr_push_open_pv is not null and non_ctr_push_open_pv>0 then t2.cl_id end) as non_ctr_push_open_uv --签到push拉起设备数
,sum(NVL(t2.non_ctr_push_open_pv,0)) as non_ctr_push_open_pv --签到push拉起人次
,count(distinct case when non_ctr_push_open_2_pv is not null and non_ctr_push_open_2_pv>0 then t5.cl_id end) as non_ctr_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.non_ctr_push_open_2_pv,0)) as non_ctr_push_open_2_pv
,count(distinct case when AI_push_open_pv is not null and AI_push_open_pv>0 then t2.cl_id end) as AI_push_open_uv --签到push拉起设备数
,sum(NVL(t2.AI_push_open_pv,0)) as AI_push_open_pv --签到push拉起人次
,count(distinct case when AI_push_open_2_pv is not null and AI_push_open_2_pv>0 then t5.cl_id end) as AI_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.AI_push_open_2_pv,0)) as AI_push_open_2_pv
,count(distinct case when orignal_auto_push_open_pv is not null and orignal_auto_push_open_pv>0 then t2.cl_id end) as orignal_auto_push_open_uv --签到push拉起设备数
,sum(NVL(t2.orignal_auto_push_open_pv,0)) as orignal_auto_push_open_pv --签到push拉起人次
,count(distinct case when orginal_auto_push_open_2_pv is not null and orginal_auto_push_open_2_pv>0 then t5.cl_id end) as orginal_auto_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.orginal_auto_push_open_2_pv,0)) as orginal_auto_push_open_2_pv
FROM
(
select
partition_date
,device_id
,device_os_type
,case WHEN active_type = '4' THEN '老活' WHEN active_type in ('1','2') then '新增' END as active_type
from online.ml_device_day_active_status
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND active_type in ('4','1','2')
AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei','','unknown')
AND first_channel_source_type not LIKE 'promotion\_jf\_%'
)t1
LEFT JOIN
(
select a.partition_date,a.cl_id --开启push设备
from
(
SELECT partition_date,cl_id,max(time_str) as max_time_str
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='is_open_push'
group by partition_date,cl_id
)a
left join
(
SELECT partition_date,
cl_id,time_str,COALESCE(params['type'],params['tyep']) as type
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='is_open_push'
)b
on b.partition_date=a.partition_date and b.cl_id=a.cl_id and b.time_str=a.max_time_str
where type=1
group by a.partition_date,a.cl_id
)is_open
on is_open.partition_date=t1.partition_date and is_open.cl_id=t1.device_id
LEFT JOIN
(
SELECT a.partition_date,a.cl_id,
count(distinct a.message_id) as push_open_pv,
count(distinct case when push_type in ('70','71') then a.message_id end) as op_push_open_pv, --运营push push_type in ('70','71')
count(distinct case when push_type in ('101','102','103','104','105') then a.message_id end) as ctr_push_open_pv, --个性化push
count(distinct case when push_type in ('111','112','113') then a.message_id end) as non_ctr_push_open_pv, --个性化push
count(distinct case when push_type in ('106','107','108') then a.message_id end) as will_push_open_pv, --意愿push
count(distinct case when push_type in ('25') then a.message_id end) as sign_push_open_pv, --签到push
count(distinct case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.message_id end) as auto_push_open_pv, --自动push
count(distinct case when push_type in ('93','94') then a.message_id end) as AI_push_open_pv,
count(distinct case when push_type is not null and push_type not in ('70','71') then a.message_id end) as orignal_auto_push_open_pv --自动push
FROM
(
SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id
FROM
(
--设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='device_opened'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id
)a
JOIN
(
--推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='notification_open'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b
on a.partition_date = b.partition_date
AND a.cl_id = b.cl_id
where abs(a.time_stamp-b.time_stamp)<=2
)a
LEFT JOIN
(
SELECT a.msg_id,case when b.msg_id is not null then 'ex' else push_type end as push_type
FROM
(
select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表
where partition_date>='20190801' AND partition_date<= regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp
)a
left join
(
SELECT if(substr(jiguang_id,1,1)=',',substr(jiguang_id,2),jiguang_id) as msg_id
FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629'
AND regexp_replace(substr(pushtime,1,10),'-','') <= regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND approver_status = 'true' --审核状态,true表示审核通过
AND status = '2' --推送状态,2表示发送成功,1表示准备发送
AND creator_id in ('32018153','32719681','32264790','31779749','31436904')
)b
on a.msg_id=b.msg_id
)e
on e.msg_id=a.message_id
group by a.partition_date,a.cl_id
)t2
on t2.cl_id=t1.device_id and t2.partition_date=t1.partition_date
LEFT JOIN
(
--push拉起后有2跳的设备
SELECT partition_date,
a.cl_id,
count(distinct a.app_session_id) as push_open_2_pv,
count(distinct case when push_type in ('70','71') then a.app_session_id end) as op_push_open_2_pv, --运营push push_type in ('70','71')
count(distinct case when push_type in ('101','102','103','104','105') then a.app_session_id end) as ctr_push_open_2_pv, --个性化push
count(distinct case when push_type in ('111','112','113') then a.app_session_id end) as non_ctr_push_open_2_pv, --个性化push
count(distinct case when push_type in ('106','107','108') then a.app_session_id end) as will_push_open_2_pv, --意愿push
count(distinct case when push_type in ('25') then a.app_session_id end) as sign_push_open_2_pv, --签到push
count(distinct case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.app_session_id end) as auto_push_open_2_pv, --自动push
count(distinct case when push_type in ('93','94') then a.app_session_id end) as AI_push_open_2_pv, --签到push
count(distinct case when push_type is not null and push_type not in ('70','71') then a.app_session_id end) as orginal_auto_push_open_2_pv --自动push
FROM
(
SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id
FROM
(
--设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='device_opened'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id
)a
JOIN
(
--推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='notification_open'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b
on a.partition_date = b.partition_date
AND a.cl_id = b.cl_id
where abs(a.time_stamp-b.time_stamp)<=2
)a
LEFT JOIN
(
SELECT a.msg_id,case when b.msg_id is not null then 'ex' else push_type end as push_type
FROM
(
select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表
where partition_date>='20190801' AND partition_date<= regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp
)a
left join
(
SELECT if(substr(jiguang_id,1,1)=',',substr(jiguang_id,2),jiguang_id) as msg_id
FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629'
AND regexp_replace(substr(pushtime,1,10),'-','') <= regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND approver_status = 'true' --审核状态,true表示审核通过
AND status = '2' --推送状态,2表示发送成功,1表示准备发送
AND creator_id in ('32018153','32719681','32264790','31779749','31436904')
)b
on a.msg_id=b.msg_id
)e
on e.msg_id=a.message_id
JOIN
(
--通过push拉起的一次会话中,有2跳,包括回退
SELECT a.partition_date,a.cl_id,a.app_session_id,a.cl_type
from
(
SELECT partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home') as is_home
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='page_view'
GROUP BY partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home')
)a
join
(
SELECT partition_date,cl_id,app_session_id,cl_type
,count(distinct page_name) as page_num
,count(distinct array(time_str,page_name)) as page_array
FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='page_view'
GROUP BY partition_date,cl_id,app_session_id,cl_type
)b
on b.partition_date=a.partition_date and b.cl_id=a.cl_id and b.app_session_id=a.app_session_id
left join
(
select device_id
from ml.ml_d_ct_dv_devicespam_d --去除机构刷单设备,即作弊设备(浏览和曝光事件去除)
WHERE partition_day=regexp_replace(DATE_SUB(current_date,1) ,'-','')
)spam
on spam.device_id=a.cl_id
where spam.device_id IS NULL and
(a.cl_type='ios' and is_home='home' and page_num>=2 and page_array>=3 or
a.cl_type='ios' and is_home='non_home' and page_array>=2 or
a.cl_type='android' and page_array>=2)
GROUP BY a.partition_date,a.cl_id,a.app_session_id,a.cl_type
)c
on a.partition_date = c.partition_date
AND a.cl_id = c.cl_id
AND a.app_session_id = c.app_session_id
GROUP BY a.cl_id,a.partition_date
)t5
on t1.partition_date=t5.partition_date and t1.device_id=t5.cl_id
GROUP BY t1.partition_date,device_os_type,active_type
order by day_id,device_os_type,active_type;
--push接收数据
INSERT OVERWRITE TABLE pm.tl_pm_push_receive_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT t1.partition_day as day_id
,t1.device_os_type as device_os_type
,'老活' as active_type
,t1.push_type as push_type
,count(distinct t1.device_id) as received_dev_num
,count(t1.msg_id) as received_msg_num
,count(distinct t2.cl_id) as click_dev_num
,count(t2.msg_id) as click_msg_num
FROM
(--接收设备数
SELECT partition_day
,device_os_type
,push_type
,a.device_id
,a.msg_id
FROM
(
select partition_day
,device_id,msg_id
from bl.bl_et_bg_trackingpushlog_inc_d
where partition_day=regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by partition_day,device_id,msg_id
)a
JOIN
(
select device_id,device_os_type
from online.ml_device_history_detail
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and first_channel_source_type not in ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei')
AND first_channel_source_type not like 'promotion\_jf\_%'
)b
on a.device_id=b.device_id
JOIN
(
select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp
union all
SELECT msg_id,regexp_replace(labels['event'], '\\s+', '') AS push_type,time_stamp
FROM online.tl_hdfs_push2_task_view
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND labels['event_type'] = 'push'
group by msg_id,regexp_replace(labels['event'], '\\s+', ''),time_stamp
)c
on a.msg_id=c.msg_id
left join
(
select
partition_date
,device_id
from online.ml_device_day_active_status
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND active_type in ('1','2','3')
and device_os_type='ios'
)d
on a.partition_day=d.partition_date and a.device_id=d.device_id
where d.device_id is null
group by partition_day
,device_os_type
,push_type
,a.device_id
,a.msg_id
)t1
left join
(--点击设备数
select partition_date
,cl_id,params['message_id'] as msg_id,time_stamp
from online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='notification_open'
group by partition_date,cl_id,params['message_id'],time_stamp
)t2
on t2.partition_date=t1.partition_day
and t2.msg_id=t1.msg_id
and t2.cl_id=t1.device_id
group by t1.partition_day
,t1.device_os_type
,t1.push_type;
\ No newline at end of file
#step1_1.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status
\ No newline at end of file
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_push2_new_view
\ No newline at end of file
#step1_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online bl_hdfs_maidian_updates
\ No newline at end of file
#step1_4.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_d_ct_dv_devicespam_d
\ No newline at end of file
#step1_5.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_api_pushtask2_view
\ No newline at end of file
#step1_6.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_history_detail
\ No newline at end of file
#step1_7.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive bl bl_et_bg_trackingpushlog_inc_d
\ No newline at end of file
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7
command=/home/bi/bi-report/lib/shell/hive daily_push
\ No newline at end of file
#step3_1.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_push_click_d
\ No newline at end of file
#step3_2.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_push_receive_d
\ No newline at end of file
#step4.job
type=command
dependencies=step3_1,step3_2
command=curl -X GET http://localhost:8553/api/report/email/daily_push/liweirui@igengmei.com,duanyingrong@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com
\ No newline at end of file
select day_id as `日期`
,device_os_type as `设备类型`
,active_type as `活跃类型`
,NVL(CONCAT(ROUND(is_open_uv/dau*100,2),'%'),0) as `push开启设备数/DAU`
,NVL(CONCAT(ROUND(op_push_open_uv/is_open_uv*100,2),'%'),0) as `运营push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_pv/is_open_uv*100,2),'%'),0) as `运营push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_uv/is_open_uv*100,2),'%'),0) as `运营push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_pv/is_open_uv*100,2),'%'),0) as `运营push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_pv/op_push_open_pv*100,2),'%'),0) as `运营push二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(AI_push_open_uv/is_open_uv*100,2),'%'),0) as `AI push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_pv/is_open_uv*100,2),'%'),0) as `AI push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_uv/is_open_uv*100,2),'%'),0) as `AI push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_pv/is_open_uv*100,2),'%'),0) as `AI push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_pv/AI_push_open_pv*100,2),'%'),0) as `AIpush二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(ctr_push_open_uv/is_open_uv*100,2),'%'),0) as `ctr push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_pv/is_open_uv*100,2),'%'),0) as `ctr push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `ctr push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `ctr push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_pv/ctr_push_open_pv*100,2),'%'),0) as `ctr push二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(non_ctr_push_open_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/non_ctr_push_open_pv*100,2),'%'),0) as `非ctr push二跳率=2跳人次/拉起人次`
from pm.tl_pm_push_click_d
where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>='20200626'
order by `日期`,`设备类型`,`活跃类型`
select day_id as `日期`
,device_os_type as `设备类型`
,active_type as `活跃类型`
,NVL(CONCAT(ROUND(sum(case when push_type = '101' then click_dev_num end)/sum(case when push_type = '101' then received_dev_num end)*100,2),'%'),0) as `ctr帖子点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '102' then click_dev_num end)/sum(case when push_type = '102' then received_dev_num end)*100,2),'%'),0) as `ctr日记点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '103' then click_dev_num end)/sum(case when push_type = '103' then received_dev_num end)*100,2),'%'),0) as `ctr回答点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '111' then click_dev_num end)/sum(case when push_type = '111' then received_dev_num end)*100,2),'%'),0) as `非ctr帖子点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '112' then click_dev_num end)/sum(case when push_type = '112' then received_dev_num end)*100,2),'%'),0) as `非ctr日记点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '113' then click_dev_num end)/sum(case when push_type = '113' then received_dev_num end)*100,2),'%'),0) as `非ctr回答点击率`
,NVL(ROUND(sum(case when push_type = '101' then received_dev_num end)/sum(case when push_type = '111' then received_dev_num end),2),0) as `ctr帖子接收设备数/非ctr帖子接收设备数`
,NVL(ROUND(sum(case when push_type = '102' then received_dev_num end)/sum(case when push_type = '112' then received_dev_num end),2),0) as `ctr日记接收设备数/非ctr日记接收设备数`
,NVL(ROUND(sum(case when push_type = '103' then received_dev_num end)/sum(case when push_type = '113' then received_dev_num end),2),0) as `ctr回答接收设备数/非ctr回答接收设备数`
,NVL(sum(case when push_type = '101' then received_dev_num end),0) as `ctr帖子接收设备数`
,NVL(sum(case when push_type = '102' then received_dev_num end),0) as `ctr日记接收设备数`
,NVL(sum(case when push_type = '103' then received_dev_num end),0) as `ctr回答接收设备数`
,NVL(sum(case when push_type = '111' then received_dev_num end),0) as `非ctr帖子接收设备数`
,NVL(sum(case when push_type = '112' then received_dev_num end),0) as `非ctr日记接收设备数`
,NVL(sum(case when push_type = '113' then received_dev_num end),0) as `非ctr回答接收设备数`
from pm.tl_pm_push_receive_d
where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>='20200626'
group by day_id
,device_os_type
,active_type
order by `日期`,`设备类型`,`活跃类型`
\ No newline at end of file
...@@ -8,8 +8,6 @@ SET mapred.reduce.tasks=20; ...@@ -8,8 +8,6 @@ SET mapred.reduce.tasks=20;
SET role admin; SET role admin;
ADD JAR hdfs:///user/hive/share/lib/udf/hive-udf-1.0-SNAPSHOT.jar;
CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade';
INSERT OVERWRITE TABLE pm.tl_pm_recommend_strategy_d PARTITION (PARTITION_DAY = ${partition_day}) INSERT OVERWRITE TABLE pm.tl_pm_recommend_strategy_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT SELECT
...@@ -37,8 +35,7 @@ FROM ...@@ -37,8 +35,7 @@ FROM
WHEN active_type IN ('1','2') THEN '新增' END AS active_type WHEN active_type IN ('1','2') THEN '新增' END AS active_type
,device_id ,device_id
FROM online.ml_device_day_active_status FROM online.ml_device_day_active_status
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND active_type IN ('1','2','4') AND active_type IN ('1','2','4')
AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3' AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang' ,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
...@@ -67,17 +64,17 @@ FROM ...@@ -67,17 +64,17 @@ FROM
WHEN transaction_type in ('-1','smr') THEN 'smr' WHEN transaction_type in ('-1','smr') THEN 'smr'
when transaction_type in ('pgc','hotspot') then '热点卡片' when transaction_type in ('pgc','hotspot') then '热点卡片'
when transaction_type in ('newdata') then '保量卡片' when transaction_type in ('newdata') then '保量卡片'
when transaction_type in ('samecity_ctr') then 'samecity_ctr'
END AS recommend_type, END AS recommend_type,
card_id, card_id,
app_session_id app_session_id
from online.ml_community_precise_exposure_detail from online.ml_community_precise_exposure_detail
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action in ('page_precise_exposure','home_choiceness_card_exposure') --7745版本action改为page_precise_exposure AND action in ('page_precise_exposure','home_choiceness_card_exposure') --7745版本action改为page_precise_exposure
AND is_exposure = '1' ----精准曝光 AND is_exposure = '1' ----精准曝光
AND page_name ='home' AND page_name ='home'
AND tab_name = '精选' AND tab_name = '精选'
AND transaction_type in ('-1','ctr','smr','cvr','hotspot','pgc','newdata') AND transaction_type in ('-1','ctr','smr','cvr','hotspot','pgc','newdata','samecity_ctr')
AND card_content_type in ('qa','diary','user_post','answer') AND card_content_type in ('qa','diary','user_post','answer')
group by partition_date, group by partition_date,
case when card_content_type in ('qa','answer') then 'qa' else card_content_type end, case when card_content_type in ('qa','answer') then 'qa' else card_content_type end,
...@@ -86,7 +83,8 @@ FROM ...@@ -86,7 +83,8 @@ FROM
WHEN transaction_type in ('cvr') THEN 'cvr预估' WHEN transaction_type in ('cvr') THEN 'cvr预估'
WHEN transaction_type in ('-1','smr') THEN 'smr' WHEN transaction_type in ('-1','smr') THEN 'smr'
when transaction_type in ('pgc','hotspot') then '热点卡片' when transaction_type in ('pgc','hotspot') then '热点卡片'
when transaction_type in ('newdata') then '保量卡片' END, when transaction_type in ('newdata') then '保量卡片'
when transaction_type in ('samecity_ctr') then 'samecity_ctr' END,
card_id, card_id,
app_session_id app_session_id
)a )a
...@@ -111,16 +109,16 @@ FROM ...@@ -111,16 +109,16 @@ FROM
WHEN params['transaction_type'] in ('-1','smr') THEN 'smr' WHEN params['transaction_type'] in ('-1','smr') THEN 'smr'
when params['transaction_type'] in ('pgc','hotspot') then '热点卡片' when params['transaction_type'] in ('pgc','hotspot') then '热点卡片'
when params['transaction_type'] in ('newdata') then '保量卡片' when params['transaction_type'] in ('newdata') then '保量卡片'
when params['transaction_type'] in ('samecity_ctr') then 'samecity_ctr'
END AS recommend_type, END AS recommend_type,
params['card_id'] as card_id, params['card_id'] as card_id,
app_session_id app_session_id
from online.bl_hdfs_maidian_updates from online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action='on_click_card' AND action='on_click_card'
AND params['page_name'] ='home' AND params['page_name'] ='home'
AND params['tab_name'] = '精选' AND params['tab_name'] = '精选'
AND params['transaction_type'] in ('-1','ctr','smr','cvr','hotspot','pgc','newdata') AND params['transaction_type'] in ('-1','ctr','smr','cvr','hotspot','pgc','newdata','samecity_ctr')
AND params['card_content_type'] in ('qa','diary','user_post','answer') AND params['card_content_type'] in ('qa','diary','user_post','answer')
GROUP BY partition_date, GROUP BY partition_date,
cl_id, cl_id,
...@@ -129,7 +127,8 @@ FROM ...@@ -129,7 +127,8 @@ FROM
WHEN params['transaction_type'] in ('cvr') THEN 'cvr预估' WHEN params['transaction_type'] in ('cvr') THEN 'cvr预估'
WHEN params['transaction_type'] in ('-1','smr') THEN 'smr' WHEN params['transaction_type'] in ('-1','smr') THEN 'smr'
when params['transaction_type'] in ('pgc','hotspot') then '热点卡片' when params['transaction_type'] in ('pgc','hotspot') then '热点卡片'
when params['transaction_type'] in ('newdata') then '保量卡片' END, when params['transaction_type'] in ('newdata') then '保量卡片'
when params['transaction_type'] in ('samecity_ctr') then 'samecity_ctr' END,
params['card_id'], params['card_id'],
app_session_id app_session_id
)a )a
...@@ -148,8 +147,7 @@ FROM ...@@ -148,8 +147,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
sum(page_stay) as page_stay sum(page_stay) as page_stay
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action='page_view' AND action='page_view'
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail') AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
AND referrer='home' AND referrer='home'
...@@ -171,8 +169,7 @@ FROM ...@@ -171,8 +169,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as navbar_pv count(1) as navbar_pv
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action in ('on_click_navbar_search','do_search') AND action in ('on_click_navbar_search','do_search')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail') AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
AND (referrer='home' or AND (referrer='home' or
...@@ -195,8 +192,7 @@ FROM ...@@ -195,8 +192,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as highlight_pv count(1) as highlight_pv
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action='on_click_card' AND action='on_click_card'
and params['card_type']='highlight_word' and params['card_type']='highlight_word'
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail') AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
...@@ -223,8 +219,7 @@ FROM ...@@ -223,8 +219,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as pv count(1) as pv
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND (get_json_object(params['extra_param'], '$.type')='交互栏' AND (get_json_object(params['extra_param'], '$.type')='交互栏'
or get_json_object(params['extra_param'], '$.jump_from')='msg_link' or get_json_object(params['extra_param'], '$.jump_from')='msg_link'
or params['in_page_pos']='top' or params['in_page_pos']='bottom') or params['in_page_pos']='top' or params['in_page_pos']='bottom')
...@@ -256,8 +251,7 @@ FROM ...@@ -256,8 +251,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as service_pv count(1) as service_pv
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND (action='on_click_card'and params['card_content_type']='service' AND (action='on_click_card'and params['card_content_type']='service'
or action='on_click_button' and params['button_name']='unfold') or action='on_click_button' and params['button_name']='unfold')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail') AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
...@@ -286,8 +280,7 @@ FROM ...@@ -286,8 +280,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name, when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as service_pv count(1) as service_pv
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
AND action='on_click_card' AND action='on_click_card'
and params['card_content_type'] in ('qa','diary','user_post','answer') and params['card_content_type'] in ('qa','diary','user_post','answer')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail') AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
...@@ -325,8 +318,7 @@ FROM ...@@ -325,8 +318,7 @@ FROM
SELECT user_id,partition_date, SELECT user_id,partition_date,
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
FROM online.ml_user_updates FROM online.ml_user_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
)t1 )t1
JOIN JOIN
( --医生账号 ( --医生账号
......
#step3.job #step3.job
type=command type=command
dependencies=step2 dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/daily_recommend_strategy/liudi@igengmei.com,wangxin@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com,zhaojianwei@igengmei.com command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_recommend_strategy_d
\ No newline at end of file \ No newline at end of file
#step4.job
type=command
dependencies=step3
command=curl -X GET http://localhost:8553/api/report/email/daily_recommend_strategy/liudi@igengmei.com,wangxin@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com
\ No newline at end of file
...@@ -4,9 +4,9 @@ SELECT ...@@ -4,9 +4,9 @@ SELECT
active_type as `活跃类型`, active_type as `活跃类型`,
card_content_type as `卡片类型`, card_content_type as `卡片类型`,
recommend_type as `推荐类型`, recommend_type as `推荐类型`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)/card_exposure*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片精准曝光PV`, NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2)/card_exposure*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片精准曝光PV`,
NVL(CONCAT(ROUND(card_click/card_exposure*100,2),'%'),0) as `首页卡片点击PV/首页卡片精准曝光PV`, NVL(CONCAT(ROUND(card_click/card_exposure*100,2),'%'),0) as `首页卡片点击PV/首页卡片精准曝光PV`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)/card_click*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片点击PV`, NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2)/card_click*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片点击PV`,
card_click as `首页卡片点击PV`, card_click as `首页卡片点击PV`,
card_exposure as `首页卡片精准曝光PV`, card_exposure as `首页卡片精准曝光PV`,
(navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)as `有效二跳pv`, (navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)as `有效二跳pv`,
......
#step2.job #step2.job
type=command type=command
dependencies=step1_1,step1_2,step1_3 dependencies=step1_1,step1_2,step1_3
command=curl -X GET http://localhost:8553/api/report/email/meigou_detail_page/liudi@igengmei.com,wangxin@igengmei.com,zhaofei@igengmei.com/weiyimin@igengmei.com,yindanlei@igengmei.com,zhaojianwei@igengmei.com command=curl -X GET http://localhost:8553/api/report/email/meigou_detail_page/liudi@igengmei.com,wangxin@igengmei.com,zhaofei@igengmei.com/weiyimin@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file \ No newline at end of file
...@@ -40,20 +40,20 @@ FROM ...@@ -40,20 +40,20 @@ FROM
,t1.device_type as `设备类型` ,t1.device_type as `设备类型`
,t1.active_type as `活跃类型` ,t1.active_type as `活跃类型`
,t2.channel as `渠道` ,t2.channel as `渠道`
,count(case when type='美购详情页' then cl_id end ) as `美购详情页浏览uv` ,count(distinct case when type='美购详情页' then cl_id end ) as `美购详情页浏览uv`
,count(case when type='加购物车' then cl_id end ) as `加购物车点击uv` ,count(distinct case when type='加购物车' then cl_id end ) as `加购物车点击uv`
,count(case when type='评价列表页' then cl_id end ) as `评价列表页点击uv` ,count(distinct case when type='评价列表页' then cl_id end ) as `评价列表页点击uv`
,count(case when type='立即支付' then cl_id end ) as `立即支付点击uv` ,count(distinct case when type='立即支付' then cl_id end ) as `立即支付点击uv`
,count(case when type='私信及电话咨询' then cl_id end ) as `私信及电话咨询uv` ,count(distinct case when type='私信及电话咨询' then cl_id end ) as `私信及电话咨询uv`
,count(case when type='选择美购项目' then cl_id end ) as `选择美购项目点击uv` ,count(distinct case when type='选择美购项目' then cl_id end ) as `选择美购项目点击uv`
,count(case when type='机构主页' then cl_id end ) as `机构主页点击uv` ,count(distinct case when type='机构主页' then cl_id end ) as `机构主页点击uv`
,count(case when type='机构的其他美购' then cl_id end ) as `机构的其他美购点击uv` ,count(distinct case when type='机构的其他美购' then cl_id end ) as `机构的其他美购点击uv`
,count(case when type='推荐美购' then cl_id end ) as `推荐美购点击uv` ,count(distinct case when type='推荐美购' then cl_id end ) as `推荐美购点击uv`
,count(case when type='收藏' then cl_id end ) as `收藏点击uv` ,count(distinct case when type='收藏' then cl_id end ) as `收藏点击uv`
,count(case when type='右上角购物车' then cl_id end ) as `右上角购物车点击uv` ,count(distinct case when type='右上角购物车' then cl_id end ) as `右上角购物车点击uv`
,count(case when type='医生主页' then cl_id end ) as `医生主页点击uv` ,count(distinct case when type='医生主页' then cl_id end ) as `医生主页点击uv`
,count(case when type='分享' then cl_id end ) as `分享点击uv` ,count(distinct case when type='分享' then cl_id end ) as `分享点击uv`
,count(case when type='机构导航' then cl_id end ) as `机构导航点击uv` ,count(distinct case when type='机构导航' then cl_id end ) as `机构导航点击uv`
FROM FROM
( (
......
...@@ -172,22 +172,22 @@ FROM ...@@ -172,22 +172,22 @@ FROM
,t1.device_type ,t1.device_type
,t1.active_type ,t1.active_type
,t2.channel ,t2.channel
,count(case when page_name = 'welfare_detail' then t1.cl_id end) as wel_uv ,count(distinct case when page_name = 'welfare_detail' then t1.cl_id end) as wel_uv
,count(case when page_name = 'search_result_more' then t1.cl_id end) as search_result_more_uv ,count(distinct case when page_name = 'search_result_more' then t1.cl_id end) as search_result_more_uv
,count(case when page_name = 'search_result_welfare' then t1.cl_id end) as search_result_welfare_uv ,count(distinct case when page_name = 'search_result_welfare' then t1.cl_id end) as search_result_welfare_uv
,count(case when page_name = 'organization_detail' then t1.cl_id end) as organization_detail_uv ,count(distinct case when page_name = 'organization_detail' then t1.cl_id end) as organization_detail_uv
,count(case when page_name = 'expert_detail' then t1.cl_id end) as expert_detail_uv ,count(distinct case when page_name = 'expert_detail' then t1.cl_id end) as expert_detail_uv
,count(case when page_name = 'category' then t1.cl_id end) as category_uv ,count(distinct case when page_name = 'category' then t1.cl_id end) as category_uv
,count(case when page_name = 'welfare_list' then t1.cl_id end) as welfare_list_uv ,count(distinct case when page_name = 'welfare_list' then t1.cl_id end) as welfare_list_uv
,count(case when page_name = 'welfare_home' then t1.cl_id end) as welfare_home_uv ,count(distinct case when page_name = 'welfare_home' then t1.cl_id end) as welfare_home_uv
,count(case when page_name = 'conversation_detail' then t1.cl_id end) as conversation_detail_uv ,count(distinct case when page_name = 'conversation_detail' then t1.cl_id end) as conversation_detail_uv
,count(case when page_name = 'my_cart' then t1.cl_id end) as my_cart_uv ,count(distinct case when page_name = 'my_cart' then t1.cl_id end) as my_cart_uv
,count(case when page_name = 'diary_detail' then t1.cl_id end) as diary_detail_uv ,count(distinct case when page_name = 'diary_detail' then t1.cl_id end) as diary_detail_uv
,count(case when page_name = 'order_detail' then t1.cl_id end) as order_detail_uv ,count(distinct case when page_name = 'order_detail' then t1.cl_id end) as order_detail_uv
,count(case when page_name ='new_sign' then t1.cl_id end) as sign_uv ,count(distinct case when page_name ='new_sign' then t1.cl_id end) as sign_uv
,count(case when page_name in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') then t1.cl_id end) as special_uv --专题和大促 ,count(distinct case when page_name in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') then t1.cl_id end) as special_uv --专题和大促
,count(case when page_name = 'zone_v3' then t1.cl_id end) as zone_uv ,count(distinct case when page_name = 'zone_v3' then t1.cl_id end) as zone_uv
,count(case when page_name in ('report_result','face_detect_result') then t1.cl_id end) as ai_report_uv --待之后增加模拟整形页面 ,count(distinct case when page_name in ('report_result','face_detect_result') then t1.cl_id end) as ai_report_uv --待之后增加模拟整形页面
FROM FROM
( (
SELECT t1.partition_date,t1.page_name,t1.cl_id,mas.device_type,mas.active_type,mas.channel SELECT t1.partition_date,t1.page_name,t1.cl_id,mas.device_type,mas.active_type,mas.channel
...@@ -256,22 +256,22 @@ LEFT JOIN ...@@ -256,22 +256,22 @@ LEFT JOIN
,t1.device_type ,t1.device_type
,t1.active_type ,t1.active_type
,t2.channel ,t2.channel
,count(case when referrer = 'welfare_detail' then t1.cl_id end) as wel_uv ,count(distinct case when referrer = 'welfare_detail' then t1.cl_id end) as wel_uv
,count(case when referrer = 'search_result_more' then t1.cl_id end) as search_result_more_uv ,count(distinct case when referrer = 'search_result_more' then t1.cl_id end) as search_result_more_uv
,count(case when referrer = 'search_result_welfare' then t1.cl_id end) as search_result_welfare_uv ,count(distinct case when referrer = 'search_result_welfare' then t1.cl_id end) as search_result_welfare_uv
,count(case when referrer = 'organization_detail' then t1.cl_id end) as organization_detail_uv ,count(distinct case when referrer = 'organization_detail' then t1.cl_id end) as organization_detail_uv
,count(case when referrer = 'expert_detail' then t1.cl_id end) as expert_detail_uv ,count(distinct case when referrer = 'expert_detail' then t1.cl_id end) as expert_detail_uv
,count(case when referrer = 'category' then t1.cl_id end) as category_uv ,count(distinct case when referrer = 'category' then t1.cl_id end) as category_uv
,count(case when referrer = 'welfare_list' then t1.cl_id end) as welfare_list_uv ,count(distinct case when referrer = 'welfare_list' then t1.cl_id end) as welfare_list_uv
,count(case when referrer = 'welfare_home' then t1.cl_id end) as welfare_home_uv ,count(distinct case when referrer = 'welfare_home' then t1.cl_id end) as welfare_home_uv
,count(case when referrer = 'conversation_detail' then t1.cl_id end) as conversation_detail_uv ,count(distinct case when referrer = 'conversation_detail' then t1.cl_id end) as conversation_detail_uv
,count(case when referrer = 'my_cart' then t1.cl_id end) as my_cart_uv ,count(distinct case when referrer = 'my_cart' then t1.cl_id end) as my_cart_uv
,count(case when referrer = 'diary_detail' then t1.cl_id end) as diary_detail_uv ,count(distinct case when referrer = 'diary_detail' then t1.cl_id end) as diary_detail_uv
,count(case when referrer = 'order_detail' then t1.cl_id end) as order_detail_uv ,count(distinct case when referrer = 'order_detail' then t1.cl_id end) as order_detail_uv
,count(case when referrer ='new_sign' then t1.cl_id end) as sign_uv ,count(distinct case when referrer ='new_sign' then t1.cl_id end) as sign_uv
,count(case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') then t1.cl_id end) as special_uv --专题和大促 ,count(distinct case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') then t1.cl_id end) as special_uv --专题和大促
,count(case when referrer = 'zone_v3' then t1.cl_id end) as zone_uv ,count(distinct case when referrer = 'zone_v3' then t1.cl_id end) as zone_uv
,count(case when referrer in ('report_result','face_detect_result') then t1.cl_id end) as ai_report_uv --待之后增加模拟整形页面 ,count(distinct case when referrer in ('report_result','face_detect_result') then t1.cl_id end) as ai_report_uv --待之后增加模拟整形页面
FROM FROM
( (
SELECT t1.partition_date,t1.referrer,t1.cl_id,mas.device_type,mas.active_type,mas.channel SELECT t1.partition_date,t1.referrer,t1.cl_id,mas.device_type,mas.active_type,mas.channel
...@@ -344,54 +344,54 @@ LEFT JOIN ...@@ -344,54 +344,54 @@ LEFT JOIN
,t1.device_type ,t1.device_type
,t1.active_type ,t1.active_type
,t2.channel ,t2.channel
,count(case when referrer = 'welfare_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_add_uv ,count(distinct case when referrer = 'welfare_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_add_uv
,count(case when referrer = 'welfare_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_buy_uv ,count(distinct case when referrer = 'welfare_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_buy_uv
,count(case when referrer = 'welfare_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_msg_uv ,count(distinct case when referrer = 'welfare_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_msg_uv
,count(case when referrer = 'search_result_more' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as result_more_add_uv ,count(distinct case when referrer = 'search_result_more' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as result_more_add_uv
,count(case when referrer = 'search_result_more' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as result_more_buy_uv ,count(distinct case when referrer = 'search_result_more' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as result_more_buy_uv
,count(case when referrer = 'search_result_more' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as result_more_msg_uv ,count(distinct case when referrer = 'search_result_more' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as result_more_msg_uv
,count(case when referrer = 'search_result_welfare' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as result_wel_add_uv ,count(distinct case when referrer = 'search_result_welfare' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as result_wel_add_uv
,count(case when referrer = 'search_result_welfare' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as result_wel_buy_uv ,count(distinct case when referrer = 'search_result_welfare' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as result_wel_buy_uv
,count(case when referrer = 'search_result_welfare' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as result_wel_msg_uv ,count(distinct case when referrer = 'search_result_welfare' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as result_wel_msg_uv
,count(case when referrer = 'organization_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as org_add_uv ,count(distinct case when referrer = 'organization_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as org_add_uv
,count(case when referrer = 'organization_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as org_buy_uv ,count(distinct case when referrer = 'organization_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as org_buy_uv
,count(case when referrer = 'organization_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as org_msg_uv ,count(distinct case when referrer = 'organization_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as org_msg_uv
,count(case when referrer = 'expert_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as exp_add_uv ,count(distinct case when referrer = 'expert_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as exp_add_uv
,count(case when referrer = 'expert_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as exp_buy_uv ,count(distinct case when referrer = 'expert_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as exp_buy_uv
,count(case when referrer = 'expert_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as exp_msg_uv ,count(distinct case when referrer = 'expert_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as exp_msg_uv
,count(case when referrer = 'category' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as category_add_uv ,count(distinct case when referrer = 'category' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as category_add_uv
,count(case when referrer = 'category' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as category_buy_uv ,count(distinct case when referrer = 'category' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as category_buy_uv
,count(case when referrer = 'category' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as category_msg_uv ,count(distinct case when referrer = 'category' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as category_msg_uv
,count(case when referrer = 'welfare_list' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_list_add_uv ,count(distinct case when referrer = 'welfare_list' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_list_add_uv
,count(case when referrer = 'welfare_list' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_list_buy_uv ,count(distinct case when referrer = 'welfare_list' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_list_buy_uv
,count(case when referrer = 'welfare_list' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_list_msg_uv ,count(distinct case when referrer = 'welfare_list' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_list_msg_uv
,count(case when referrer = 'welfare_home' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_home_add_uv ,count(distinct case when referrer = 'welfare_home' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as wel_home_add_uv
,count(case when referrer = 'welfare_home' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_home_buy_uv ,count(distinct case when referrer = 'welfare_home' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as wel_home_buy_uv
,count(case when referrer = 'welfare_home' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_home_msg_uv ,count(distinct case when referrer = 'welfare_home' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as wel_home_msg_uv
,count(case when referrer = 'conversation_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as conv_add_uv ,count(distinct case when referrer = 'conversation_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as conv_add_uv
,count(case when referrer = 'conversation_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as conv_buy_uv ,count(distinct case when referrer = 'conversation_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as conv_buy_uv
,count(case when referrer = 'conversation_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as conv_msg_uv ,count(distinct case when referrer = 'conversation_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as conv_msg_uv
,count(case when referrer = 'my_cart' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as cart_add_uv ,count(distinct case when referrer = 'my_cart' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as cart_add_uv
,count(case when referrer = 'my_cart' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as cart_buy_uv ,count(distinct case when referrer = 'my_cart' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as cart_buy_uv
,count(case when referrer = 'my_cart' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as cart_msg_uv ,count(distinct case when referrer = 'my_cart' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as cart_msg_uv
,count(case when referrer = 'diary_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as diary_add_uv ,count(distinct case when referrer = 'diary_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as diary_add_uv
,count(case when referrer = 'diary_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as diary_buy_uv ,count(distinct case when referrer = 'diary_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as diary_buy_uv
,count(case when referrer = 'diary_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as diary_msg_uv ,count(distinct case when referrer = 'diary_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as diary_msg_uv
,count(case when referrer = 'order_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as order_add_uv ,count(distinct case when referrer = 'order_detail' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as order_add_uv
,count(case when referrer = 'order_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as order_buy_uv ,count(distinct case when referrer = 'order_detail' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as order_buy_uv
,count(case when referrer = 'order_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as order_msg_uv ,count(distinct case when referrer = 'order_detail' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as order_msg_uv
,count(case when referrer = 'new_sign' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as sign_add_uv ,count(distinct case when referrer = 'new_sign' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as sign_add_uv
,count(case when referrer = 'new_sign' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as sign_buy_uv ,count(distinct case when referrer = 'new_sign' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as sign_buy_uv
,count(case when referrer = 'new_sign' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as sign_msg_uv ,count(distinct case when referrer = 'new_sign' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as sign_msg_uv
,count(case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as special_add_uv ,count(distinct case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as special_add_uv
,count(case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as special_buy_uv ,count(distinct case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as special_buy_uv
,count(case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as special_msg_uv ,count(distinct case when referrer in ('special_polymer','newt_welfare_special','welfare_special','activity_promotion_seckill','activity_promotion','custom_special') and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as special_msg_uv
,count(case when referrer = 'zone_v3' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as zone_add_uv ,count(distinct case when referrer = 'zone_v3' and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as zone_add_uv
,count(case when referrer = 'zone_v3' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as zone_buy_uv ,count(distinct case when referrer = 'zone_v3' and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as zone_buy_uv
,count(case when referrer = 'zone_v3' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as zone_msg_uv ,count(distinct case when referrer = 'zone_v3' and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as zone_msg_uv
,count(case when referrer in ('report_result','face_detect_result') and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as ai_add_uv ,count(distinct case when referrer in ('report_result','face_detect_result') and action = 'welfare_multiattribute_click_add' then t1.cl_id end) as ai_add_uv
,count(case when referrer in ('report_result','face_detect_result') and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as ai_buy_uv ,count(distinct case when referrer in ('report_result','face_detect_result') and action = 'welfare_multiattribute_click_buy' then t1.cl_id end) as ai_buy_uv
,count(case when referrer in ('report_result','face_detect_result') and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as ai_msg_uv ,count(distinct case when referrer in ('report_result','face_detect_result') and action in ('welfare_detail_click_message','on_click_button') then t1.cl_id end) as ai_msg_uv
FROM FROM
( (
......
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/search_related/liudi@igengmei.com,wangxin@igengmei.com,malinxi@igengmei.com,duanyingrong@igengmei.com,dengguangyu@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com,zhaojianwei@igengmei.com
\ No newline at end of file
#step3_1.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_click_path_d
\ No newline at end of file
#step3_2.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_input_type_d
\ No newline at end of file
#step3_3.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_result_click_rate_d
\ No newline at end of file
#step4.job
type=command
dependencies=step3_1,step3_2,step3_3
command=curl -X GET http://localhost:8553/api/report/email/search_related/liudi@igengmei.com,wangxin@igengmei.com,duanyingrong@igengmei.com,dengguangyu@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment