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 2609A200B9F for ; Tue, 11 Oct 2016 22:32:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 24AEC160AE6; Tue, 11 Oct 2016 20:32:14 +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 6D0B3160AC3 for ; Tue, 11 Oct 2016 22:32:13 +0200 (CEST) Received: (qmail 26237 invoked by uid 500); 11 Oct 2016 20:32:12 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 26226 invoked by uid 99); 11 Oct 2016 20:32:12 -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, 11 Oct 2016 20:32:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B73EDFCF2; Tue, 11 Oct 2016 20:32:12 +0000 (UTC) From: rxin To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org Message-ID: Subject: [GitHub] spark pull request #15438: [SPARK-17845][SQL] More self-evident window funct... Content-Type: text/plain Date: Tue, 11 Oct 2016 20:32:12 +0000 (UTC) archived-at: Tue, 11 Oct 2016 20:32:14 -0000 GitHub user rxin opened a pull request: https://github.com/apache/spark/pull/15438 [SPARK-17845][SQL] More self-evident window function frame boundary API ## What changes were proposed in this pull request? This patch improves the window function frame boundary API to make it more obvious to read and to use. The two high level changes are: 1. Create Window.currentRow, Window.unboundedPreceding, Window.unboundedFollowing to indicate the special values in frame boundaries. These methods map to the special integral values so we are not breaking backward compatibility here. This change makes the frame boundaries more self-evident (instead of Long.MinValue, it becomes Window.unboundedPreceding). 2. In Python, for any value less than or equal to JVM's Long.MinValue, treat it as Window.unboundedPreceding. For any value larger than or equal to JVM's Long.MaxValue, treat it as Window.unboundedFollowing. Before this change, if the user specifies any value that is less than Long.MinValue but not -sys.maxsize (e.g. -sys.maxsize + 1), the number we pass over to the JVM would overflow, resulting in a frame that does not make sense. ## How was this patch tested? Updated DataFrameWindowSuite (for Scala/Java) and test_window_functions_cumulative_sum (for Python). You can merge this pull request into a Git repository by running: $ git pull https://github.com/rxin/spark SPARK-17845 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15438.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #15438 ---- commit c91864b1df83e9f06a9a463aacf4d7db43478141 Author: Reynold Xin Date: 2016-10-11T20:11:00Z [SPARK-17845][SQL] More self-evident window function frame boundary API commit d806ae9a8423774a6a28c01de1668b97c32d9250 Author: Reynold Xin Date: 2016-10-11T20:23:52Z Fixed Python test ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org