Skip to content

[improvement] Add new session variable session_context#10101

Closed
morningman wants to merge 2 commits intoapache:masterfrom
morningman:session_context
Closed

[improvement] Add new session variable session_context#10101
morningman wants to merge 2 commits intoapache:masterfrom
morningman:session_context

Conversation

@morningman
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

Add a new session variable: session_context and it can be set like:
set session_context="k1:v1;k2:v2;..."
Where k:v is key-value pair.

This is used to pass some user-defined or pre-defined session variables from client to server.
For example, I add a pre-defined key: trace_id, And I can use the following stmt:

select /*+SET_VAR(session_context=trace_id:123456) */ xxxx from tbl ....;

And Doris will get this trace id and saved it in profile. After that, user can use this trace id to get the query id, then
get some other info (eg, query profile) by query id.

Also, user can pass the trace id to Doris, so that we can monitor Doris's execution in some tracing system.

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@morningman morningman added kind/improvement api-review Categorizes an issue or PR as actively needing an API review. labels Jun 13, 2022
@morningman morningman marked this pull request as draft June 13, 2022 12:02
@morningman morningman closed this Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. kind/improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant