Example #1
0
from thrift.transport.TSocket import TSocket
from thrift.transport.TTransport import TBufferedTransport, TTransportException
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException

VERSION_FORMAT = "Impala v%(version)s (%(git_hash)s) built on %(build_date)s"
COMMENT_TOKEN = '--'
VERSION_STRING = "build version not available"
HISTORY_LENGTH = 100

# Tarball / packaging build makes impala_build_version available
try:
  from impala_build_version import get_git_hash, get_build_date, get_version
  VERSION_STRING = VERSION_FORMAT % {'version': get_version(),
                                     'git_hash': get_git_hash()[:7],
                                     'build_date': get_build_date()}
except Exception:
  pass

class RpcStatus:
  """Convenience enum to describe Rpc return statuses"""
  OK = 0
  ERROR = 1

# Simple Impala shell. Can issue queries (with configurable options)
# Basic usage: type connect <host:port> to connect to an impalad
# Then issue queries or other commands. Tab-completion should show the set of
# available commands.
# Methods that implement shell commands return a boolean tuple (stop, status)
# stop is a flag the command loop uses to continue/discontinue the prompt.
# Status tells the caller that the command completed successfully.
Example #2
0
from ImpalaService.ImpalaService import TImpalaQueryOptions
from JavaConstants.constants import DEFAULT_QUERY_OPTIONS
from thrift.transport.TSocket import TSocket
from thrift.transport.TTransport import TBufferedTransport, TTransportException
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException

VERSION_STRING = "Impala v0.1 "
COMMENT_TOKEN = '--'

# Tarball / packaging build makes impala_build_version available
try:
    from impala_build_version import get_version_string
    from impala_build_version import get_build_date
    VERSION_STRING += "(" + get_version_string(
    )[:7] + ") built on " + get_build_date()
except Exception:
    VERSION_STRING += "(build version not available)"


class RpcStatus:
    """Convenience enum to describe Rpc return statuses"""
    OK = 0
    ERROR = 1


# Simple Impala shell. Can issue queries (with configurable options)
# Basic usage: type connect <host:port> to connect to an impalad
# Then issue queries or other commands. Tab-completion should show the set of
# available commands.
# Methods that implement shell commands return a boolean tuple (stop, status)
Example #3
0
from thrift.transport.TTransport import TBufferedTransport, TTransportException
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException

VERSION_FORMAT = "Impala v%(version)s (%(git_hash)s) built on %(build_date)s"
COMMENT_TOKEN = '--'
VERSION_STRING = "build version not available"
HISTORY_LENGTH = 100

# Tarball / packaging build makes impala_build_version available
try:
    from impala_build_version import get_git_hash, get_build_date, get_version
    VERSION_STRING = VERSION_FORMAT % {
        'version': get_version(),
        'git_hash': get_git_hash()[:7],
        'build_date': get_build_date()
    }
except Exception:
    pass


class RpcStatus:
    """Convenience enum to describe Rpc return statuses"""
    OK = 0
    ERROR = 1


class OutputWriter(object):
    """Helper class for saving result set output to a file"""
    def __init__(self, file_name, field_delim):
        # The default csv field size limit is too small to write large result sets. Set it to
Example #4
0
from ImpalaService import ImpalaService
from ImpalaService.ImpalaService import TImpalaQueryOptions
from JavaConstants.constants import DEFAULT_QUERY_OPTIONS
from thrift.transport.TSocket import TSocket
from thrift.transport.TTransport import TBufferedTransport, TTransportException
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException

VERSION_STRING = "Impala v0.1 "
COMMENT_TOKEN = '--'

# Tarball / packaging build makes impala_build_version available
try:
  from impala_build_version import get_version_string
  from impala_build_version import get_build_date
  VERSION_STRING += "(" + get_version_string()[:7] + ") built on " + get_build_date()
except Exception:
  VERSION_STRING += "(build version not available)"

class RpcStatus:
  """Convenience enum to describe Rpc return statuses"""
  OK = 0
  ERROR = 1

# Simple Impala shell. Can issue queries (with configurable options)
# Basic usage: type connect <host:port> to connect to an impalad
# Then issue queries or other commands. Tab-completion should show the set of
# available commands.
# Methods that implement shell commands return a boolean tuple (stop, status)
# stop is a flag the command loop uses to continue/discontinue the prompt.
# Status tells the caller that the command completed successfully.