def setup_class(cls): if pytest.config.option.namenode_http_address is None: hdfs_conf = HdfsConfig(pytest.config.option.minicluster_xml_conf) cls.hdfs_client = get_hdfs_client_from_conf(hdfs_conf) else: host, port = pytest.config.option.namenode_http_address.split(":") cls.hdfs_client = get_hdfs_client(host, port)
def setup_class(cls): super(TestInsertBehaviourCustomCluster, cls).setup_class() if pytest.config.option.namenode_http_address is None: hdfs_conf = HdfsConfig(pytest.config.option.minicluster_xml_conf) cls.hdfs_client = get_hdfs_client_from_conf(hdfs_conf) else: host, port = pytest.config.option.namenode_http_address.split(":") cls.hdfs_client = get_hdfs_client(host, port)
from hive_metastore import ThriftHiveMetastore from thrift.transport import TTransport, TSocket from thrift.protocol import TBinaryProtocol logging.basicConfig(level=logging.INFO, format='-- %(message)s') LOG = logging.getLogger('impala_test_suite') IMPALAD_HOST_PORT_LIST = pytest.config.option.impalad.split(',') assert len( IMPALAD_HOST_PORT_LIST) > 0, 'Must specify at least 1 impalad to target' IMPALAD = IMPALAD_HOST_PORT_LIST[0] IMPALAD_HS2_HOST_PORT =\ IMPALAD.split(':')[0] + ":" + pytest.config.option.impalad_hs2_port HIVE_HS2_HOST_PORT = pytest.config.option.hive_server2 WORKLOAD_DIR = os.environ['IMPALA_WORKLOAD_DIR'] HDFS_CONF = HdfsConfig(pytest.config.option.minicluster_xml_conf) # Base class for Impala tests. All impala test cases should inherit from this class class ImpalaTestSuite(BaseTestSuite): @classmethod def add_test_dimensions(cls): """ A hook for adding additional dimensions. By default load the table_info and exec_option dimensions, but if a test wants to add more dimensions or different dimensions they can override this function. """ super(ImpalaTestSuite, cls).add_test_dimensions() cls.TestMatrix.add_dimension( cls.create_table_info_dimension(cls.exploration_strategy()))
from hive_metastore import ThriftHiveMetastore from thrift.transport import TTransport, TSocket from thrift.protocol import TBinaryProtocol logging.basicConfig(level=logging.INFO, format='-- %(message)s') LOG = logging.getLogger('impala_test_suite') IMPALAD_HOST_PORT_LIST = pytest.config.option.impalad.split(',') assert len( IMPALAD_HOST_PORT_LIST) > 0, 'Must specify at least 1 impalad to target' IMPALAD = IMPALAD_HOST_PORT_LIST[0] IMPALAD_HS2_HOST_PORT =\ IMPALAD.split(':')[0] + ":" + pytest.config.option.impalad_hs2_port HIVE_HS2_HOST_PORT = pytest.config.option.hive_server2 WORKLOAD_DIR = os.environ['IMPALA_WORKLOAD_DIR'] HDFS_CONF = HdfsConfig(pytest.config.option.minicluster_xml_conf) CORE_CONF = HdfsConfig( os.path.join(os.environ['HADOOP_CONF_DIR'], "core-site.xml")) TARGET_FILESYSTEM = os.getenv("TARGET_FILESYSTEM") or "hdfs" IMPALA_HOME = os.getenv("IMPALA_HOME") # FILESYSTEM_PREFIX is the path prefix that should be used in queries. When running # the tests against the default filesystem (fs.defaultFS), FILESYSTEM_PREFIX is the # empty string. When running against a secondary filesystem, it will be the scheme # and authority porotion of the qualified path. FILESYSTEM_PREFIX = os.getenv("FILESYSTEM_PREFIX") # NAMENODE is the path prefix that should be used in results, since paths that come # out of Impala have been qualified. When running against the default filesystem, # this will be the same as fs.defaultFS. When running against a secondary filesystem, # this will be the same as FILESYSTEM_PREFIX. NAMENODE = FILESYSTEM_PREFIX or CORE_CONF.get('fs.defaultFS')
from hive_metastore import ThriftHiveMetastore from thrift.transport import TTransport, TSocket from thrift.protocol import TBinaryProtocol logging.basicConfig(level=logging.INFO, format='-- %(message)s') LOG = logging.getLogger('impala_test_suite') IMPALAD_HOST_PORT_LIST = pytest.config.option.impalad.split(',') assert len(IMPALAD_HOST_PORT_LIST) > 0, 'Must specify at least 1 impalad to target' IMPALAD = IMPALAD_HOST_PORT_LIST[0] IMPALAD_HS2_HOST_PORT =\ IMPALAD.split(':')[0] + ":" + pytest.config.option.impalad_hs2_port HIVE_HS2_HOST_PORT = pytest.config.option.hive_server2 WORKLOAD_DIR = os.environ['IMPALA_WORKLOAD_DIR'] HDFS_CONF = HdfsConfig(pytest.config.option.minicluster_xml_conf) CORE_CONF = HdfsConfig(os.path.join(os.environ['HADOOP_CONF_DIR'], "core-site.xml")) TARGET_FILESYSTEM = os.getenv("TARGET_FILESYSTEM") or "hdfs" IMPALA_HOME = os.getenv("IMPALA_HOME") # FILESYSTEM_PREFIX is the path prefix that should be used in queries. When running # the tests against the default filesystem (fs.defaultFS), FILESYSTEM_PREFIX is the # empty string. When running against a secondary filesystem, it will be the scheme # and authority porotion of the qualified path. FILESYSTEM_PREFIX = os.getenv("FILESYSTEM_PREFIX") # NAMENODE is the path prefix that should be used in results, since paths that come # out of Impala have been qualified. When running against the default filesystem, # this will be the same as fs.defaultFS. When running against a secondary filesystem, # this will be the same as FILESYSTEM_PREFIX. NAMENODE = FILESYSTEM_PREFIX or CORE_CONF.get('fs.defaultFS') # Base class for Impala tests. All impala test cases should inherit from this class class ImpalaTestSuite(BaseTestSuite):