From issues-return-173963-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Jun 29 17:08:22 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D5222180663 for ; Fri, 29 Jun 2018 17:08:21 +0200 (CEST) Received: (qmail 71160 invoked by uid 500); 29 Jun 2018 15:08:21 -0000 Mailing-List: contact issues-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 issues@flink.apache.org Received: (qmail 71151 invoked by uid 99); 29 Jun 2018 15:08:20 -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; Fri, 29 Jun 2018 15:08:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D0B3CE0BC0; Fri, 29 Jun 2018 15:08:20 +0000 (UTC) From: fhueske To: issues@flink.apache.org Reply-To: issues@flink.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #6188: [FLINK-6846][Table API] add timestampAdd tableApi Content-Type: text/plain Message-Id: <20180629150820.D0B3CE0BC0@git1-us-west.apache.org> Date: Fri, 29 Jun 2018 15:08:20 +0000 (UTC) Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/6188#discussion_r199190279 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1029,6 +1029,29 @@ object temporalOverlaps { TemporalOverlaps(leftTimePoint, leftTemporal, rightTimePoint, rightTemporal) } } +/** + * Adds a (signed) integer interval to a timestamp. The unit for the interval is given + * by the unit argument, which should be one of the following values: "SECOND", "MINUTE", + * "HOUR", "DAY", "WEEK", "MONTH", "QUARTER" or "YEAR". + * + * e.g. timestampAdd("WEEK", 1, '2003-01-02'.toDate) leads to "2003-01-09". + */ +object timestampAdd { + + /** + * Adds a (signed) integer interval to a timestamp. The unit for the interval is given + * by the unit argument, which should be one of the following values: "SECOND", "MINUTE", + * "HOUR", "DAY", "WEEK", "MONTH", "QUARTER" or "YEAR". + * + * e.g. timestampAdd("WEEK", 1, '2003-01-02'.toDate) leads to "2003-01-09". + */ + def apply( + unit: Expression, --- End diff -- I think we can and should add `week`. `quarter` is a bit more tricky... IMO, the current method is not well aligned with the other methods (`hour`, `day`, etc.) and it would make sense to change it for better consistency. However, such as change would break the API. What do you think @twalthr? ---