How to use the pyexasol.utils function in pyexasol

To help you get started, we’ve selected a few pyexasol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github badoo / pyexasol / pyexasol / script_output.py View on Github external
def start(self):
        args = [sys.executable,
                '-m', 'pyexasol', 'script_output',
                '--output-dir', str(self.output_dir),
                '--ppid', str(utils.get_pid())
                ]

        if self.host:
            args.append('--host')
            args.append(self.host)

        if self.port:
            args.append('--port')
            args.append(str(self.port))

        self.proc = subprocess.Popen(args, stdout=subprocess.PIPE)
        self.output_address = self.proc.stdout.readline().decode().rstrip('\n')

        self.proc.stdout.close()
github badoo / pyexasol / pyexasol / script_output.py View on Github external
def service_actions(self):
        utils.check_orphaned(self.initial_ppid)
github badoo / pyexasol / pyexasol / connection.py View on Github external
def execute_udf_output(self, query, query_params=None):
        """
        Execute SQL query with UDF script, capture output
        Return ExaStatement object and list of Path-objects for script output log files

        Exasol should be able to open connection to the host where current script is running
        """

        self._udf_output_count += 1
        output_dir = utils.get_output_dir_for_statement(self.options['udf_output_dir'],
                                                        self.session_id(),
                                                        self._udf_output_count)

        script_output = ExaScriptOutputProcess(self.options['udf_output_bind_address'][0],
                                               self.options['udf_output_bind_address'][1],
                                               output_dir)
        script_output.start()

        # This option is useful to get around complex network setups, like Exasol running in Docker containers
        if self.options['udf_output_connect_address']:
            address = f"{self.options['udf_output_connect_address'][0]}:{self.options['udf_output_connect_address'][1]}"
        else:
            address = script_output.get_output_address()

        self.execute("ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS = {address}", {'address': address})