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 2016/10/17 05:38:24 UTC

spark git commit: [MINOR][SQL] Add prettyName for current_database function

Repository: spark
Updated Branches:
  refs/heads/master e18d02c5a -> 56b0f5f4d


[MINOR][SQL] Add prettyName for current_database function

## What changes were proposed in this pull request?
Added a `prettyname` for current_database function.

## How was this patch tested?
Manually.

Before:
```
scala> sql("select current_database()").show
+-----------------+
|currentdatabase()|
+-----------------+
|          default|
+-----------------+
```

After:
```
scala> sql("select current_database()").show
+------------------+
|current_database()|
+------------------+
|           default|
+------------------+
```

Author: Weiqing Yang <ya...@gmail.com>

Closes #15506 from weiqingy/prettyName.


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

Branch: refs/heads/master
Commit: 56b0f5f4d1d7826737b81ebc4ec5dad83b6463e3
Parents: e18d02c
Author: Weiqing Yang <ya...@gmail.com>
Authored: Sun Oct 16 22:38:30 2016 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Sun Oct 16 22:38:30 2016 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/56b0f5f4/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
index 138ef2a..5ead169 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
@@ -618,6 +618,7 @@ case class CurrentDatabase() extends LeafExpression with Unevaluable {
   override def dataType: DataType = StringType
   override def foldable: Boolean = true
   override def nullable: Boolean = false
+  override def prettyName: String = "current_database"
 }
 
 /**


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