Files
impala/tests/query_test/test_delimited_text.py
Lenni Kuff bb09b5270f IMPALA-839: Update tests to be more thorough when run exhaustively
Some tests have constraints that were there only to help reduce runtime which
reduces coverage when running in exhaustive mode. The majority of the constraints
are because it adds no value to run the test across additional dimensions (or
it is invalid to run with those dimensions). Updates the tests that have
legitimate constraints to use two new helper methods for constraining the table format
dimension:
create_uncompressed_text_dimension()
create_parquet_dimension()

These will create a dimension that will produce a single test vector, either
uncompressed text or parquet respectively.

Change-Id: Id85387c1efd5d192f8059ef89934933389bfe247
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2149
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
(cherry picked from commit e02acbd469bc48c684b2089405b4a20552802481)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2290
2014-04-18 20:11:31 -07:00

54 lines
2.0 KiB
Python
Executable File

#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted Impala tests for different tuple delimiters, field delimiters,
# and escape characters.
#
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
from tests.common.test_dimensions import create_exec_option_dimension
from tests.common.test_dimensions import create_uncompressed_text_dimension
class TestDelimitedText(ImpalaTestSuite):
"""
Tests delimited text files with different tuple delimiters, field delimiters
and escape characters.
"""
TEST_DB_NAME = "delim_text_test_db"
@classmethod
def get_workload(self):
return 'functional-query'
@classmethod
def add_test_dimensions(cls):
super(TestDelimitedText, cls).add_test_dimensions()
cls.TestMatrix.add_dimension(create_single_exec_option_dimension())
# Only run on delimited text with no compression.
cls.TestMatrix.add_dimension(create_uncompressed_text_dimension(cls.get_workload()))
def setup_method(self, method):
# cleanup and create a fresh test database
self.__cleanup()
self.execute_query("create database %s" % self.TEST_DB_NAME)
def teardown_method(self, method):
self.__cleanup()
def __cleanup(self):
self.client.execute('use default')
self.client.execute('drop table if exists %s.cbn' % self.TEST_DB_NAME)
self.client.execute('drop table if exists %s.dhp' % self.TEST_DB_NAME)
self.client.execute('drop table if exists %s.tecn' % self.TEST_DB_NAME)
self.client.execute('drop database if exists %s' % self.TEST_DB_NAME)
def test_delimited_text(self, vector):
self.run_test_case('QueryTest/delimited-text', vector)
@pytest.mark.execute_serially
def test_delimited_text_latin_chars(self, vector):
"""Verifies Impala is able to properly handle delimited text that contains
extended ASCII/latin characters. Marked as running serial because of shared
cleanup/setup"""
self.run_test_case('QueryTest/delimited-latin-text', vector, encoding="latin-1")