Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5043

Function that returns a unique id per session/connection similar to MySQL's CONNECTION_ID()

    XMLWordPrintableJSON

Details

    Description

      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

       boolean isNiladic

      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:

      select session_id from <table>  // returns the value of niladic function session_id 
      select t1.session_id from <table> t1 // returns session_id column value from table 

      Attachments

        1. 01_session_id_sqlline.png
          3 kB
          Nagarajan Chinnasamy
        2. 02_session_id_webconsole_query.png
          5 kB
          Nagarajan Chinnasamy
        3. 03_session_id_webconsole_result.png
          7 kB
          Nagarajan Chinnasamy

        Issue Links

          Activity

            People

              arina Arina Ielchiieva
              nagarajanchinnasamy Nagarajan Chinnasamy
              Krystal Krystal
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: