MCPcopy Create free account
hub / github.com/apache/impala / run_impala_shell_interactive

Function run_impala_shell_interactive

tests/shell/test_shell_interactive.py:1352–1367  ·  view source on GitHub ↗

Runs a command in the Impala shell interactively.

(vector, input_lines, shell_args=None,
                                 wait_until_connected=True)

Source from the content-addressed store, hash-verified

1350
1351
1352def run_impala_shell_interactive(vector, input_lines, shell_args=None,
1353 wait_until_connected=True):
1354 """Runs a command in the Impala shell interactively."""
1355 # if argument "input_lines" is a string, makes it into a list
1356 if type(input_lines) is str:
1357 input_lines = [input_lines]
1358 # workaround to make Popen environment 'utf-8' compatible
1359 # since piping defaults to ascii
1360 my_env = os.environ
1361 my_env['PYTHONIOENCODING'] = 'utf-8'
1362 p = ImpalaShell(vector, args=shell_args, env=my_env,
1363 wait_until_connected=wait_until_connected)
1364 for line in input_lines:
1365 LOG.info("Running %s" % line)
1366 p.send_cmd(line)
1367 return p.get_result()

Calls 4

send_cmdMethod · 0.95
get_resultMethod · 0.95
ImpalaShellClass · 0.90
typeEnum · 0.50

Tested by

no test coverage detected