From bae7224ff625c607c1f8072ed277c3b3a9fa0ea5 Mon Sep 17 00:00:00 2001 From: Yina Chen <33650826+cyita@users.noreply.github.com> Date: Thu, 25 Mar 2021 14:24:08 +0800 Subject: [PATCH] add list of df support (#3113) --- python/bigdl/utils/common.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/bigdl/utils/common.py b/python/bigdl/utils/common.py index f15d7a554af..f4f51834af3 100644 --- a/python/bigdl/utils/common.py +++ b/python/bigdl/utils/common.py @@ -627,6 +627,11 @@ def _java2py(gateway, r, encoding="bytes"): if clsName in _picklable_classes: r = gateway.jvm.org.apache.spark.bigdl.api.python.BigDLSerDe.dumps(r) + elif isinstance(r, (JavaArray, JavaList)) and len(r) != 0 \ + and isinstance(r[0], JavaObject) \ + and r[0].getClass().getSimpleName() in ['DataFrame', 'Dataset']: + spark = get_spark_sql_context(get_spark_context()) + r = list(map(lambda x: DataFrame(x, spark), r)) elif isinstance(r, (JavaArray, JavaList, JavaMap)): try: r = gateway.jvm.org.apache.spark.bigdl.api.python.BigDLSerDe.dumps(