[ 
https://issues.apache.org/jira/browse/PHOENIX-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14338887#comment-14338887
 ] 

James Taylor commented on PHOENIX-1115:
---------------------------------------

Looks very good, [~rajeshbabu]. Just a couple minor nits:
- Rename TRACE_ID_COLUMN_PROJECTOR to TRACE_PROJECTOR. The meaning of this is 
"what are the column names and types of rows that'll be returned when a TRACE 
(ON|OFF) statement is run.
- Declare your TRACE_PROJECTOR as final and don't set it to null:
{code}
+    private static final RowProjector TRACE_PROJECTOR;
+    static {
          ....
+        TRACE_PROJECTOR = new RowProjector(projectedColumns, 
estimatedByteSize, false);
+    }
{code}
- Pass the PhoenixStatement instead of the PhoenixConnection through the 
TraceQueryPlan constructor. You can always get the connection from a statement 
with stmt.getConnection().
- Add a final StatementContext context member  to TraceQueryPlan and initialize 
in constructor to this.context = new StatementContext(stmt);
- Instead of returning null for getContext(), return this.context. I'm not sure 
if our code handles StatementContext being null.
- Change TraceQueryPlan.getProjector() to just return TRACE_PROJECTOR. No need 
to use EMPTY_PROJECTOR, as the next() call on your iterator would just return 
no rows when tracing is off.
- Change TraceQueryPlan.getOrderBy() to return OrderBy.EMPTY_ORDER_BY.
- Change TraceQueryPlan.getGroupBy() to return GroupBy.EMPTY_GROUP_BY;
- Change TraceQueryPlan.getSplits() and TraceQueryPlan.getScans() to return 
Collections.emptyList();

+1 after these minor changes. Any feedback [~samarthjain]?

> 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: Sub-task
>            Reporter: James Taylor
>            Assignee: Rajeshbabu Chintaguntla
>             Fix For: 5.0.0
>
>         Attachments: PHOENIX-1115.patch, PHOENIX-1115_v2.patch, 
> PHOENIX-1115_v3.patch, PHOENIX-1115_v4.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
(v6.3.4#6332)

Reply via email to