[ https://issues.apache.org/jira/browse/PHOENIX-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16553996#comment-16553996 ]
zhengsicheng commented on PHOENIX-1115: --------------------------------------- Hi [~rajeshbabu] [~jamestaylor] apache-phoenix-4.13.1-HBase-1.1-bin hbase-1.1.6 hadoop-2.7.1 1.copy $PHOENIX_HOME/bin/hadoop-metrics2-hbase.properties and hadoop-metrics2-phoenix.properties to $HBASE_HOME/conf 2. add hbase-site.xml <property> <name>phoenix.trace.frequency</name> <value>always</value> </property> 3.run $PHOENIX_HOME/bin/sqlline.py 0: jdbc:phoenix:localhost:2181:/hbase> trace; Error: ERROR 601 (42P00): Syntax error. Encountered "<EOF>" at line 1, column 6. (state=42P00,code=601) org.apache.phoenix.exception.PhoenixParserException: ERROR 601 (42P00): Syntax error. Encountered "<EOF>" at line 1, column 6. at org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33) at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111) at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:1578) at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1661) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1732) at sqlline.Commands.execute(Commands.java:822) at sqlline.Commands.sql(Commands.java:732) at sqlline.SqlLine.dispatch(SqlLine.java:813) at sqlline.SqlLine.begin(SqlLine.java:686) at sqlline.SqlLine.start(SqlLine.java:398) at sqlline.SqlLine.main(SqlLine.java:291) Caused by: NoViableAltException(-1@[]) at org.apache.phoenix.parse.PhoenixSQLParser.trace_node(PhoenixSQLParser.java:3145) at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:962) at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:520) at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108) ... 9 more 0: jdbc:phoenix:localhost:2181:/hbase> trace on; +----------------------+ | trace_id | +----------------------+ | -810952810666141955 | +----------------------+ 1 row selected (0.001 seconds) 0: jdbc:phoenix:localhost:2181:/hbase> upsert into t values(1,2); 1 row affected (0.014 seconds) 0: jdbc:phoenix:localhost:2181:/hbase> trace on; +----------------------+ | trace_id | +----------------------+ | -810952810666141955 | +----------------------+ 1 row selected (0.001 seconds) 0: jdbc:phoenix:localhost:2181:/hbase> trace off; +----------------------+ | trace_id | +----------------------+ | -810952810666141955 | +----------------------+ 1 row selected (0.001 seconds) 0: jdbc:phoenix:localhost:2181:/hbase> trace off; +-----------+ | trace_id | +-----------+ +-----------+ No rows selected (0 seconds) 0: jdbc:phoenix:localhost:2181:/hbase> select * from SYSTEM.TRACING_STATS where trace_id=-810952810666141955; +-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+ | TRACE_ID | PARENT_ID | SPAN_ID | DESCRIPTION | START_TIME | END_TIME | HOSTNAME | COUNT | COUNT | +-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+ +-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+ No rows selected (0.089 seconds) no data in SYSTEM.TRACING_STATS? > Provide a SQL command to turn tracing on/off > -------------------------------------------- > > Key: PHOENIX-1115 > URL: https://issues.apache.org/jira/browse/PHOENIX-1115 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Assignee: Rajeshbabu Chintaguntla > Priority: Major > Labels: tracing > Fix For: 4.3.1, 4.4.0 > > Attachments: PHOENIX-1115.patch, PHOENIX-1115_v2.patch, > PHOENIX-1115_v3.patch, PHOENIX-1115_v4.patch, PHOENIX-1115_v5.patch, Screen > Shot 2014-11-21 at 3.41.41 PM.png, tracing_in_different_rdbms.pdf > > > Provide a SQL command that turns tracing on and off. For example, Oracle has > this: > {code} > ALTER SESSION SET sql_trace = true; > ALTER SESSION SET sql_trace = false; > {code} > We might consider allowing the sampling rate to be set as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)