Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 12A98200D0E for ; Tue, 26 Sep 2017 13:55:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 111741609C1; Tue, 26 Sep 2017 11:55:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56F251609B4 for ; Tue, 26 Sep 2017 13:55:55 +0200 (CEST) Received: (qmail 64044 invoked by uid 500); 26 Sep 2017 11:55:54 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 64035 invoked by uid 99); 26 Sep 2017 11:55:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 11:55:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4E45BF54DD; Tue, 26 Sep 2017 11:55:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: twalthr@apache.org To: commits@flink.apache.org Message-Id: <373fc8e267e04784926fa14479ac0dcf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: flink git commit: [hotfix] [docs] Simplify and fix Table UDF docs Date: Tue, 26 Sep 2017 11:55:54 +0000 (UTC) archived-at: Tue, 26 Sep 2017 11:55:56 -0000 Repository: flink Updated Branches: refs/heads/master d3458ec7b -> 2d393e882 [hotfix] [docs] Simplify and fix Table UDF docs Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/2d393e88 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/2d393e88 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/2d393e88 Branch: refs/heads/master Commit: 2d393e882fd99fa6bcd5df19ff1aa345909c145c Parents: d3458ec Author: twalthr Authored: Tue Sep 26 13:54:23 2017 +0200 Committer: twalthr Committed: Tue Sep 26 13:55:21 2017 +0200 ---------------------------------------------------------------------- docs/dev/table/udfs.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/2d393e88/docs/dev/table/udfs.md ---------------------------------------------------------------------- diff --git a/docs/dev/table/udfs.md b/docs/dev/table/udfs.md index 16f21e9..71567d8 100644 --- a/docs/dev/table/udfs.md +++ b/docs/dev/table/udfs.md @@ -235,8 +235,7 @@ public class CustomTypeSplit extends TableFunction { @Override public TypeInformation getResultType() { - return new RowTypeInfo(new TypeInformation[]{ - BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO}); + return Types.ROW(Types.STRING(), Types.INT()); } } {% endhighlight %} @@ -255,8 +254,7 @@ class CustomTypeSplit extends TableFunction[Row] { } override def getResultType: TypeInformation[Row] = { - new RowTypeInfo(Seq(BasicTypeInfo.STRING_TYPE_INFO, - BasicTypeInfo.INT_TYPE_INFO)) + Types.ROW(Types.STRING, Types.INT) } } {% endhighlight %} @@ -526,7 +524,7 @@ public static class WeightedAvgAccum { /** * Weighted Average user-defined aggregate function. */ -public static class WeightedAvg extends AggregateFunction { +public static class WeightedAvg extends AggregateFunction { @Override public WeightedAvgAccum createAccumulator() { @@ -534,7 +532,7 @@ public static class WeightedAvg extends AggregateFunction JLong, Integer => JInteger} import org.apache.flink.api.java.tuple.{Tuple1 => JTuple1} -import org.apache.flink.api.common.typeinfo.{BasicTypeInfo, TypeInformation} import org.apache.flink.api.java.typeutils.TupleTypeInfo +import org.apache.flink.table.api.Types import org.apache.flink.table.functions.AggregateFunction /** @@ -635,13 +633,10 @@ class WeightedAvg extends AggregateFunction[JLong, CountAccumulator] { } override def getAccumulatorType: TypeInformation[WeightedAvgAccum] = { - new TupleTypeInfo(classOf[WeightedAvgAccum], - BasicTypeInfo.LONG_TYPE_INFO, - BasicTypeInfo.INT_TYPE_INFO) + new TupleTypeInfo(classOf[WeightedAvgAccum], Types.LONG, Types.INT) } - override def getResultType: TypeInformation[JLong] = - BasicTypeInfo.LONG_TYPE_INFO + override def getResultType: TypeInformation[JLong] = Types.LONG } // register function