[
https://issues.apache.org/jira/browse/DRILL-5043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Krystal closed DRILL-5043.
--------------------------
Verified that session_id function works as expected via the following tests:
1. Each sqlline session returns different session_id.
2. In the same session, multiple "select session_id" queries return the same
result.
3. For table with column name of "session_id", using table alias with column in
the select clause returns data for column.
4. Ran tests from sqlline and Web UI; with and without impersonation.
> Function that returns a unique id per session/connection similar to MySQL's
> CONNECTION_ID()
> -------------------------------------------------------------------------------------------
>
> Key: DRILL-5043
> URL: https://issues.apache.org/jira/browse/DRILL-5043
> Project: Apache Drill
> Issue Type: Improvement
> Components: Functions - Drill
> Affects Versions: 1.8.0
> Reporter: Nagarajan Chinnasamy
> Assignee: Arina Ielchiieva
> Priority: Minor
> Labels: CONNECTION_ID, SESSION, UDF, doc-impacting
> Fix For: 1.10.0
>
> Attachments: 01_session_id_sqlline.png,
> 02_session_id_webconsole_query.png, 03_session_id_webconsole_result.png
>
>
> Design and implement a function that returns a unique id per
> session/connection similar to MySQL's CONNECTION_ID().
> *Implementation details*
> function *session_id* will be added. Function returns current session unique
> id represented as string. Parameter {code:java} boolean isNiladic{code} will
> be added to UDF FunctionTemplate to indicate if a function is niladic (a
> function to be called without any parameters and parentheses)
> Please note, this function will override columns that have the same name.
> Table alias should be used to retrieve column value from table.
> Example:
> {code:sql}select session_id from <table> // returns the value of niladic
> function session_id {code}
> {code:sql}select t1.session_id from <table> t1 // returns session_id column
> value from table {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)