Apache DataFusion SQL Query Engine
ARROW-3144: [C++/Python] Move "dictionary" member from DictionaryType to ArrayData to allow for variable dictionaries
Wes McKinneybae5c4dde839
diff --git a/.travis.yml b/.travis.ymlindex 92ba3b7a99..82a88791b9 100644--- a/.travis.yml+++ b/.travis.yml@@ -44,6 +44,8 @@ before_install:matrix:+ allow_failures:+ - language: rfast_finish: trueinclude:- name: "Lint C++, Python, R, Docker"diff --git a/integration/integration_test.py b/integration/integration_test.pyindex 4c3a354d31..9aafb6cd73 100644--- a/integration/integration_test.py+++ b/integration/integration_test.py@@ -973,22 +973,25 @@ def generate_nested_case():def generate_dictionary_case():+ dict_type0 = StringType('dictionary1')dict_type1 = StringType('dictionary1')dict_type2 = get_field('dictionary2', 'int64')- dict1 = Dictionary(0, dict_type1,- dict_type1.generate_column(10, name='DICT0'))- dict2 = Dictionary(1, dict_type2,- dict_type2.generate_column(50, name='DICT1'))+ dict0 = Dictionary(0, dict_type0,+ dict_type0.generate_column(10, name='DICT0'))+ dict1 = Dictionary(1, dict_type1,+ dict_type1.generate_column(5, name='DICT1'))+ dict2 = Dictionary(2, dict_type2,+ dict_type2.generate_column(50, name='DICT2'))fields = [- DictionaryType('dict1_0', get_field('', 'int8'), dict1),- DictionaryType('dict1_1', get_field('', 'int32'), dict1),- DictionaryType('dict2_0', get_field('', 'int16'), dict2)+ DictionaryType('dict0', get_field('', 'int8'), dict0),+ DictionaryType('dict1', get_field('', 'int32'), dict1),+ DictionaryType('dict2', get_field('', 'int16'), dict2)]batch_sizes = [7, 10]return _generate_file("dictionary", fields, batch_sizes,- dictionaries=[dict1, dict2])+ dictionaries=[dict0, dict1, dict2])def get_generated_json_files(tempdir=None, flight=False):@@ -1144,8 +1147,9 @@ class Tester(object):FLIGHT_CLIENT = FalseFLIGHT_PORT = 31337- def __init__(self, debug=False):- self.debug = debug+ def __init__(self, args):+ self.args = args+ self.debug = args.debugdef json_to_file(self, json_path, arrow_path):raise NotImplementedError@@ -1416,20 +1420,28 @@ def get_static_json_files():for p in glob.glob(glob_pattern)]-def run_all_tests(run_flight=False, debug=False, tempdir=None):- testers = [CPPTester(debug=debug),- JavaTester(debug=debug),- JSTester(debug=debug)]+def run_all_tests(args):+ testers = []++ if args.enable_cpp:+ testers.append(CPPTester(args))++ if args.enable_java:+ testers.append(JavaTester(args))++ if args.enable_js:+ testers.append(JSTester(args))+static_json_files = get_static_json_files()- generated_json_files = get_generated_json_files(tempdir=tempdir,- flight=run_flight)+ generated_json_files = get_generated_json_files(tempdir=args.tempdir,+ flight=args.run_flight)json_files = static_json_files + generated_json_filesrunner = IntegrationRunner(json_files, testers,- tempdir=tempdir, debug=debug)+ tempdir=args.tempdir, debug=args.debug)failures = []failures.extend(runner.run())- if run_flight:+ if args.run_flight:failures.extend(runner.run_flight())fail_count = 0@@ -1463,6 +1475,17 @@ def write_js_test_json(directory):if __name__ == '__main__':parser = argparse.ArgumentParser(description='Arrow integration test CLI')++ parser.add_argument('--enable-c++', dest='enable_cpp',+ action='store', type=int, default=1,+ help='Include C++ in integration tests')+ parser.add_argument('--enable-java', dest='enable_java',+ action='store', type=int, default=1,+ help='Include Java in integration tests')+ parser.add_argument('--enable-js', dest='enable_js',+ action='store', type=int, default=1,+ help='Include JavaScript in integration tests')+parser.add_argument('--write_generated_json', dest='generated_json_path',action='store', default=False,help='Generate test JSON')@@ -1485,5 +1508,4 @@ if __name__ == '__main__':raisewrite_js_test_json(args.generated_json_path)else:- run_all_tests(run_flight=args.run_flight,- debug=args.debug, tempdir=args.tempdir)+ run_all_tests(args)