Skip to content

Commit 5e13db6

Browse files
juwentus1234shrinidhijoshi
authored andcommitted
Add kQueryTraceNodeId in presto session config (prestodb#25684)
Summary: use kQueryTraceNodeId in presto to setup the specific node to trace and replay in consistent with velox side. Reviewed By: skyelves, zacw7, xiaoxmeng Differential Revision: D79608355
1 parent 28ffe1a commit 5e13db6

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

presto-docs/src/main/sphinx/presto_cpp/properties-session.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ underlying file system.
345345
* **Default value:** ``false``
346346

347347
Enable query tracing. After enabled, trace data will be generated with query execution, and
348-
can be used by TraceReplayer. It needs to be used together with native_query_trace_node_ids,
348+
can be used by TraceReplayer. It needs to be used together with native_query_trace_node_id,
349349
native_query_trace_max_bytes, native_query_trace_fragment_id, and native_query_trace_shard_id
350350
to match the task to be traced.
351351

@@ -358,14 +358,13 @@ to match the task to be traced.
358358

359359
The location to store the trace files.
360360

361-
``native_query_trace_node_ids``
361+
``native_query_trace_node_id``
362362
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
363363

364364
* **Type:** ``varchar``
365365
* **Default value:** ``""``
366366

367-
A comma-separated list of plan node ids whose input data will be traced.
368-
Empty string if only want to trace the query metadata.
367+
The plan node id whose input data will be traced.
369368

370369
``native_query_trace_max_bytes``
371370
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -487,4 +486,4 @@ This is used in global arbitration victim selection.
487486
* **Default value:** ``0``
488487

489488
Maximum number of splits to listen to by the SplitListener per table scan node per
490-
native worker.
489+
native worker.

presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class NativeWorkerSessionPropertyProvider
6161
public static final String NATIVE_MAX_OUTPUT_BUFFER_SIZE = "native_max_output_buffer_size";
6262
public static final String NATIVE_QUERY_TRACE_ENABLED = "native_query_trace_enabled";
6363
public static final String NATIVE_QUERY_TRACE_DIR = "native_query_trace_dir";
64-
public static final String NATIVE_QUERY_TRACE_NODE_IDS = "native_query_trace_node_ids";
64+
public static final String NATIVE_QUERY_TRACE_NODE_ID = "native_query_trace_node_id";
6565
public static final String NATIVE_QUERY_TRACE_MAX_BYTES = "native_query_trace_max_bytes";
6666
public static final String NATIVE_QUERY_TRACE_FRAGMENT_ID = "native_query_trace_fragment_id";
6767
public static final String NATIVE_QUERY_TRACE_SHARD_ID = "native_query_trace_shard_id";
@@ -243,8 +243,8 @@ public NativeWorkerSessionPropertyProvider(FeaturesConfig featuresConfig)
243243
"Base dir of a query to store tracing data.",
244244
"",
245245
!nativeExecution),
246-
stringProperty(NATIVE_QUERY_TRACE_NODE_IDS,
247-
"A comma-separated list of plan node ids whose input data will be traced. Empty string if only want to trace the query metadata.",
246+
stringProperty(NATIVE_QUERY_TRACE_NODE_ID,
247+
"The plan node id whose input data will be traced.",
248248
"",
249249
!nativeExecution),
250250
longProperty(NATIVE_QUERY_TRACE_MAX_BYTES,

presto-native-execution/presto_cpp/main/SessionProperties.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,12 @@ SessionProperties::SessionProperties() {
301301
c.queryTraceDir());
302302

303303
addSessionProperty(
304-
kQueryTraceNodeIds,
305-
"A comma-separated list of plan node ids whose input data will be traced."
306-
" Empty string if only want to trace the query metadata.",
304+
kQueryTraceNodeId,
305+
"The plan node id whose input data will be traced.",
307306
VARCHAR(),
308307
false,
309-
QueryConfig::kQueryTraceNodeIds,
310-
c.queryTraceNodeIds());
308+
QueryConfig::kQueryTraceNodeId,
309+
c.queryTraceNodeId());
311310

312311
addSessionProperty(
313312
kQueryTraceMaxBytes,

presto-native-execution/presto_cpp/main/SessionProperties.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,9 @@ class SessionProperties {
230230
/// Base dir of a query to store tracing data.
231231
static constexpr const char* kQueryTraceDir = "native_query_trace_dir";
232232

233-
/// A comma-separated list of plan node ids whose input data will be traced.
234-
/// Empty string if only want to trace the query metadata.
235-
static constexpr const char* kQueryTraceNodeIds =
236-
"native_query_trace_node_ids";
233+
/// The plan node id whose input data will be traced.
234+
static constexpr const char* kQueryTraceNodeId =
235+
"native_query_trace_node_id";
237236

238237
/// The max trace bytes limit. Tracing is disabled if zero.
239238
static constexpr const char* kQueryTraceMaxBytes =
@@ -310,7 +309,7 @@ class SessionProperties {
310309
"native_streaming_aggregation_min_output_batch_rows";
311310

312311
/// Maximum wait time for exchange long poll requests in seconds.
313-
static constexpr const char* kRequestDataSizesMaxWaitSec =
312+
static constexpr const char* kRequestDataSizesMaxWaitSec =
314313
"native_request_data_sizes_max_wait_sec";
315314

316315
/// Priority of memory pool reclaimer when deciding on memory pool to abort.

0 commit comments

Comments
 (0)