Skip to content

Apache DataFusion SQL Query Engine

ARROW-4871: [Java/Flight] Handle large Flight messages

David Li5cd4d0f0dd17
diff --git a/integration/integration_test.py b/integration/integration_test.py
index 17e7afb18d..d6cb9657ae 100644
--- a/integration/integration_test.py
+++ b/integration/integration_test.py
@@ -896,7 +896,7 @@ def generate_dictionary_case():
dictionaries=[dict1, dict2])
-def get_generated_json_files(tempdir=None):
+def get_generated_json_files(tempdir=None, flight=False):
tempdir = tempdir or tempfile.mkdtemp()
def _temp_path():
@@ -911,6 +911,10 @@ def get_generated_json_files(tempdir=None):
generate_dictionary_case()
]
+ if flight:
+ file_objs.append(generate_primitive_case([32 * 1024],
+ name='large_batch'))
+
generated_paths = []
for file_obj in file_objs:
out_path = os.path.join(tempdir, 'generated_' +
@@ -951,11 +955,9 @@ class IntegrationRunner(object):
clients = filter(lambda t: (t.FLIGHT_CLIENT and t.CONSUMER),
self.testers)
for server, client in itertools.product(servers, clients):
- try:
- self._compare_flight_implementations(server, client)
- except Exception:
- traceback.print_exc()
- failures.append((server, client, sys.exc_info()))
+ for failure in self._compare_flight_implementations(server,
+ client):
+ failures.append(failure)
return failures
def _compare_implementations(self, producer, consumer):
@@ -1004,15 +1006,19 @@ class IntegrationRunner(object):
)
print('##########################################################')
- with producer.flight_server():
- for json_path in self.json_files:
- print('=' * 58)
- print('Testing file {0}'.format(json_path))
- print('=' * 58)
+ for json_path in self.json_files:
+ print('=' * 58)
+ print('Testing file {0}'.format(json_path))
+ print('=' * 58)
+ with producer.flight_server():
# Have the client upload the file, then download and
# compare
- consumer.flight_request(producer.FLIGHT_PORT, json_path)
+ try:
+ consumer.flight_request(producer.FLIGHT_PORT, json_path)
+ except Exception:
+ traceback.print_exc()
+ yield (producer, consumer, sys.exc_info())
class Tester(object):
@@ -1297,7 +1303,8 @@ def run_all_tests(run_flight=False, debug=False, tempdir=None):
JavaTester(debug=debug),
JSTester(debug=debug)]
static_json_files = get_static_json_files()
- generated_json_files = get_generated_json_files(tempdir=tempdir)
+ generated_json_files = get_generated_json_files(tempdir=tempdir,
+ flight=run_flight)
json_files = static_json_files + generated_json_files
runner = IntegrationRunner(json_files, testers,