aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst
diff options
context:
space:
mode:
authorCheng Hao <hao.cheng@intel.com>2015-05-14 00:14:59 +0800
committerCheng Lian <lian@databricks.com>2015-05-14 00:14:59 +0800
commit0da254fb2903c01e059fa7d0dc81df5740312b35 (patch)
treec99831581e4987626b950f0df96ce36a26e0ee53 /sql/catalyst
parentaa6ba3f2166edcc8bcda3abc70482fa8605e83b7 (diff)
downloadspark-0da254fb2903c01e059fa7d0dc81df5740312b35.tar.gz
spark-0da254fb2903c01e059fa7d0dc81df5740312b35.tar.bz2
spark-0da254fb2903c01e059fa7d0dc81df5740312b35.zip
[SPARK-6734] [SQL] Add UDTF.close support in Generate
Some third-party UDTF extensions generate additional rows in the "GenericUDTF.close()" method, which is supported / documented by Hive. https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide+UDTF However, Spark SQL ignores the "GenericUDTF.close()", and it causes bug while porting job from Hive to Spark SQL. Author: Cheng Hao <hao.cheng@intel.com> Closes #5383 from chenghao-intel/udtf_close and squashes the following commits: 98b4e4b [Cheng Hao] Support UDTF.close
Diffstat (limited to 'sql/catalyst')
-rw-r--r--sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
index 9a6cb048af..747a47bdde 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
@@ -56,6 +56,12 @@ abstract class Generator extends Expression {
/** Should be implemented by child classes to perform specific Generators. */
override def eval(input: Row): TraversableOnce[Row]
+
+ /**
+ * Notifies that there are no more rows to process, clean up code, and additional
+ * rows can be made here.
+ */
+ def terminate(): TraversableOnce[Row] = Nil
}
/**