Files
impala/shell/impala_shell_config_defaults.py
Martin Grund ed18dd4a8b IMPALA-80: Dynamic progress reporting for the shell
This patch adds a way to allow for dynamic progress reporting in the
shell. There are two new command line flags for the shell

   --live_progress - will print the completed vs total # of scan ranges
   --live_summary - prints an updated exec summary

In addition to the command line flags, these options can be set from
within the shell using:

   set LIVE_SUMMARY=True
   set LIVE_PROGRESS=True

The new options will be listed under shell options. Both reports will be
updated at most every second, for longer running queries it will be
adjusted to the time between two RPC calls to get the query status. To
provide this information in the ExecSummary, the Thrift structure for
the ExecSummary was extended to contain a progress indicator. The output
is printed to stderr and only available in interactive mode.

An example video is available here:

https://asciinema.org/a/5wi7ypckx4ol4ha1hlg3e3q1k

Change-Id: I70b2ab5fa74dc2ba5bc3b338ef13ddc6ccf367d2
Reviewed-on: http://gerrit.cloudera.org:8080/508
Tested-by: Internal Jenkins
Reviewed-by: Martin Grund <mgrund@cloudera.com>
2015-07-17 17:59:29 +00:00

46 lines
1.5 KiB
Python

#!/usr/bin/env python
# Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# defaults for OptionParser options stored in dict
import getpass
import os
import socket
impala_shell_defaults = {
'impalad': socket.getfqdn() + ':21000',
'query': None,
'query_file': None,
'use_kerberos': False,
'output_file': None,
'write_delimited': False,
'print_header': False,
'output_delimiter': '\\t',
'kerberos_service_name': 'impala',
'verbose': True,
'show_profiles': False,
'version': False,
'ignore_query_failure': False,
'refresh_after_connect': False,
'default_db': None,
'use_ldap': False,
'user': getpass.getuser(),
'ssl': False,
'ca_cert': None,
'config_file': os.path.expanduser("~/.impalarc"),
'print_progress' : False,
'print_summary' : False
}