Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C6FA1126B for ; Sat, 16 Aug 2014 18:27:06 +0000 (UTC) Received: (qmail 33511 invoked by uid 500); 16 Aug 2014 18:27:06 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 33467 invoked by uid 500); 16 Aug 2014 18:27:06 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 33458 invoked by uid 99); 16 Aug 2014 18:27:06 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Aug 2014 18:27:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 47AFE8AEEDD; Sat, 16 Aug 2014 18:27:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: marmbrus@apache.org To: commits@spark.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: [SQL] Using safe floating-point numbers in doctest Date: Sat, 16 Aug 2014 18:27:06 +0000 (UTC) Repository: spark Updated Branches: refs/heads/branch-1.1 0e0ec2eeb -> 8c7957446 [SQL] Using safe floating-point numbers in doctest Test code in `sql.py` tries to compare two floating-point numbers directly, and cased [build failure(s)](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18365/consoleFull). [Doctest documentation](https://docs.python.org/3/library/doctest.html#warnings) recommends using numbers in the form of `I/2**J` to avoid the precision issue. Author: Cheng Lian Closes #1925 from liancheng/fix-pysql-fp-test and squashes the following commits: 0fbf584 [Cheng Lian] Removed unnecessary `...' from inferSchema doctest e8059d4 [Cheng Lian] Using safe floating-point numbers in doctest (cherry picked from commit b4a05928e95c0f6973fd21e60ff9c108f226e38c) Signed-off-by: Michael Armbrust Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8c795744 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8c795744 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8c795744 Branch: refs/heads/branch-1.1 Commit: 8c79574462eed113fc59d4323eedfc55c6e95c06 Parents: 0e0ec2e Author: Cheng Lian Authored: Sat Aug 16 11:26:51 2014 -0700 Committer: Michael Armbrust Committed: Sat Aug 16 11:27:02 2014 -0700 ---------------------------------------------------------------------- python/pyspark/sql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/8c795744/python/pyspark/sql.py ---------------------------------------------------------------------- diff --git a/python/pyspark/sql.py b/python/pyspark/sql.py index 95086a2..d4ca0cc 100644 --- a/python/pyspark/sql.py +++ b/python/pyspark/sql.py @@ -1093,8 +1093,8 @@ class SQLContext: >>> sqlCtx.sql( ... "SELECT byte1 - 1 AS byte1, byte2 + 1 AS byte2, " + ... "short1 + 1 AS short1, short2 - 1 AS short2, int - 1 AS int, " + - ... "float + 1.1 as float FROM table2").collect() - [Row(byte1=126, byte2=-127, short1=-32767, short2=32766, int=2147483646, float=2.1...)] + ... "float + 1.5 as float FROM table2").collect() + [Row(byte1=126, byte2=-127, short1=-32767, short2=32766, int=2147483646, float=2.5)] >>> rdd = sc.parallelize([(127, -32768, 1.0, ... datetime(2010, 1, 1, 1, 1, 1), --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org