Repository: spark
Updated Branches:
refs/heads/branch-2.0 3cc2fe5b9 -> ca66f52ff
[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 <[email protected]>
Closes #15506 from weiqingy/prettyName.
(cherry picked from commit 56b0f5f4d1d7826737b81ebc4ec5dad83b6463e3)
Signed-off-by: Reynold Xin <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ca66f52f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ca66f52f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ca66f52f
Branch: refs/heads/branch-2.0
Commit: ca66f52ff81c19e17ca3733eac92d66012a3ec6e
Parents: 3cc2fe5
Author: Weiqing Yang <[email protected]>
Authored: Sun Oct 16 22:38:30 2016 -0700
Committer: Reynold Xin <[email protected]>
Committed: Sun Oct 16 22:38:36 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/ca66f52f/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 92f8fb8..5c4436f 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
@@ -564,4 +564,5 @@ 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: [email protected]
For additional commands, e-mail: [email protected]