Skip to content
improveme edited this page Oct 24, 2017 · 3 revisions

pike提供了各种选项查看提交的sql和topology

pike <command> <options>
commands:
-exec                   generate topology from SQL and submit it to storm cluster
-h                      print this help
-v                      show pike version info
-schema                         generate schema from SQL
-transferColumns                        generate transfer columns from SQL
-version                show pike version pure number string
-showtables             show all table name
-desc <table name>      show columns of the specified table
-showtopos              show all running topologies
-topoconf -n <topology name>    show topology running configuration
-toposql -n <topology name>     show topology sql
-adddbtable -e <sql string>     add new table to db used by jdbc output
usage: options
-compile                  only compile SQL, no submit
-D <property=value>       override sql/topology configuration property
-e,--sql                  read pike SQL from command line
-explain                  show SQL compiled logical query plan, no submit
-f,--sqlfile <arg>        read pike SQL from file
-gentopo                  compile SQL and generate storm topoloty, no submit
-ldf <arg>                table data file in local mode
-local                    local mode
-lsec <arg>               local mode run seconds before exit, default is unlimit
-ltf <arg>                table info xml file in local mode
-n,--topologyname <arg>   read pike SQL from file
-nooptimize               no optimize when use -explain to show plan
-p                        print submitter console.
-parse                    only parse SQL, don't do semantic analyzing
-td,--topology-debug      set generated topology in debug mode
-tridentgraph             compile SQL and generate storm trident plan, display the graph, no submit

example:

pike -exec -e "set pike.output.targets.default='sqlserverbulk.cl_calc_client_error_5m';
               withperiod 5m 
               select output(dt(5*60)) as dt, errortype, count(distinct userid) as uv
               from dol_error 
               group by errortype" -n client_error_5m

为方便调试,可使用 -local 指定用storm local模式以本地进程模拟运行,执行结果默认输出到控制台。

Clone this wiki locally