You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/07/20 18:43:31 UTC

spark git commit: [SQL] Remove space from DataFrame Scala/Java API.

Repository: spark
Updated Branches:
  refs/heads/master 04db58ae3 -> c6fe9b4a1


[SQL] Remove space from DataFrame Scala/Java API.

I don't think this function is useful at all in Scala/Java, since users can easily compute n * space easily.

Author: Reynold Xin <rx...@databricks.com>

Closes #7530 from rxin/remove-space and squashes the following commits:

c147873 [Reynold Xin] [SQL] Remove space from DataFrame Scala/Java API.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c6fe9b4a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c6fe9b4a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c6fe9b4a

Branch: refs/heads/master
Commit: c6fe9b4a179eecce69a813501dd0f4a22ff5dd5b
Parents: 04db58a
Author: Reynold Xin <rx...@databricks.com>
Authored: Mon Jul 20 09:43:25 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Mon Jul 20 09:43:25 2015 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/sql/functions.scala  | 20 --------------------
 .../apache/spark/sql/StringFunctionsSuite.scala |  4 ----
 2 files changed, 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c6fe9b4a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
index b5140dc..41b25d1 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
@@ -2237,26 +2237,6 @@ object functions {
     StringReverse(str.expr)
   }
 
-  /**
-   * Make a n spaces of string.
-   *
-   * @group string_funcs
-   * @since 1.5.0
-   */
-  def space(n: String): Column = {
-    space(Column(n))
-  }
-
-  /**
-   * Make a n spaces of string.
-   *
-   * @group string_funcs
-   * @since 1.5.0
-   */
-  def space(n: Column): Column = {
-    StringSpace(n.expr)
-  }
-
   //////////////////////////////////////////////////////////////////////////////////////////////
   // DateTime functions
   //////////////////////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/spark/blob/c6fe9b4a/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala
index fe4de8d..413f385 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala
@@ -191,10 +191,6 @@ class StringFunctionsSuite extends QueryTest {
     val df = Seq((2, 3)).toDF("a", "b")
 
     checkAnswer(
-      df.select(space($"a"), space("b")),
-      Row("  ", "   "))
-
-    checkAnswer(
       df.selectExpr("space(b)"),
       Row("   "))
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org