Uploaded image for project: 'Solution Center'
  1. Solution Center
  2. SOL-598

UDFs and Scripts: Redirect output for debugging

    Details

    • Type: Explanation
    • Status: Obsolete
    • Affects Version/s: Exasol 6.1.0
    • Fix Version/s: None
    • Component/s: EXAplus, EXASolution
    • Labels:
      None
    • Solution:
      Hide

      Note: This solution is no longer maintained. For the latest information, please check our documentation portal: 

      https://docs.exasol.com/database_concepts/udf_scripts/debug_udf_script_output.htm

      ------------------------------------------------------------------------------------------------------------------------------------------

      For any UDF script and virtual schema adapter script, except LUA scripts, users can redirect the scripts standard output and standard error file descriptor to any socket on other machines.

      Prerequesites:

      You need to have Python 2.x installed on your machine. If you want to use Python 3.x, then please follow the instructions here: https://github.com/badoo/pyexasol/blob/master/docs/SCRIPT_OUTPUT.md

       

      With Pyhton 2.x, this redirection can be activated in SQL sessions using the python script found here: https://github.com/EXASOL/hadoop-etl-udfs/blob/master/tools/udf_debug.py

      Download the python script from link above.

      Run the python script within your command line interface - output should appear similar to this:

      Go to EXAplus and activate the redirection in Exasol sessions using the command below. Replace some_host and some_port with the values matching your setup (e.g. 10.242.2.21:3000):

      ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS='some_host:some_port';

      Run your UDF in EXAplus (attached are examples of various UDFs: Python, R and Java supported in Exasol)

      To direct the debug output to a specific node the following variables can be used:

      Node_id (local node_id starting with 0) and vm_id (unique id for the local machine)

      Once run the debug output should appear in the command line seen attached in screenshot (OUTPUT)

      To disable the output redirection again, clear the parameter SCRIPT_OUTPUT_ADDRESS:

      ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS='';

      Make sure, the port you specified (e.g. 3000) is accessible on your machine. If the output address cannot be opened, an error is displayed to the user.

      Show
      Note: This solution is no longer maintained. For the latest information, please check our documentation portal:  https://docs.exasol.com/database_concepts/udf_scripts/debug_udf_script_output.htm ------------------------------------------------------------------------------------------------------------------------------------------ For any UDF script and virtual schema adapter script, except LUA scripts, users can redirect the scripts standard output and standard error file descriptor to any socket on other machines. Prerequesites: You need to have Python 2.x installed on your machine. If you want to use Python 3.x, then please follow the instructions here:  https://github.com/badoo/pyexasol/blob/master/docs/SCRIPT_OUTPUT.md   With Pyhton 2.x, this redirection can be activated in SQL sessions using the python script found here: https://github.com/EXASOL/hadoop-etl-udfs/blob/master/tools/udf_debug.py Download the python script from link above. Run the python script within your command line interface - output should appear similar to this: Go to EXAplus and activate the redirection in Exasol sessions using the command below. Replace some_host and some_port with the values matching your setup (e.g. 10.242.2.21:3000 ): ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS= 'some_host:some_port' ; Run your UDF in EXAplus (attached are examples of various UDFs: Python, R and Java supported in Exasol) To direct the debug output to a specific node the following variables can be used: Node_id (local node_id starting with 0) and vm_id (unique id for the local machine) Once run the debug output should appear in the command line seen attached in screenshot (OUTPUT) To disable the output redirection again, clear the parameter SCRIPT_OUTPUT_ADDRESS: ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS=''; Make sure, the port you specified (e.g. 3000) is accessible on your machine. If the output address cannot be opened, an error is displayed to the user.
    • Category 1:
      UDFs and In-Database Analytics - R
    • Category 2:
      UDFs and In-Database Analytics - java

      Attachments

      1. JAVA_UDF.png
        JAVA_UDF.png
        14 kB
      2. OUTPUT.png
        OUTPUT.png
        4 kB
      3. PYTHON_UDF.png
        PYTHON_UDF.png
        10 kB
      4. R_UDF.png
        R_UDF.png
        8 kB
      5. RUNSCRIPT_COMMANDLINE.png
        RUNSCRIPT_COMMANDLINE.png
        3 kB

        Activity

          People

          • Assignee:
            CaptainEXA Captain EXASOL
            Reporter:
            CaptainEXA Captain EXASOL
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: