Skip to content

Conversation

@hvanhovell
Copy link
Contributor

@hvanhovell hvanhovell commented Aug 1, 2016

What changes were proposed in this pull request?

In Spark 1.6 (with Hive support) we could use CURRENT_DATE and CURRENT_TIMESTAMP functions as literals (without adding braces), for example:

select /* Spark 1.6: */ current_date, /* Spark 1.6  & Spark 2.0: */ current_date()

This was accidentally dropped in Spark 2.0. This PR reinstates this functionality.

How was this patch tested?

Added a case to ExpressionParserSuite.

@SparkQA
Copy link

SparkQA commented Aug 1, 2016

Test build #63088 has finished for PR 14442 at commit f614781.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@davies
Copy link
Contributor

davies commented Aug 1, 2016

LGTM

@gatorsmile
Copy link
Member

LGTM

FYI, MySQL and PostgreSQL support NOW as a synonym of CURRENT_TIMESTAMP

@rxin
Copy link
Contributor

rxin commented Aug 2, 2016

Can you add an end-to-end test for this in SQLQuerySuite? It's not a great place but we will refactor it soon.

@SparkQA
Copy link

SparkQA commented Aug 2, 2016

Test build #63117 has finished for PR 14442 at commit fd9906c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Aug 2, 2016

Thanks - merging in master/2.0.

asfgit pushed a commit that referenced this pull request Aug 2, 2016
…erals

## What changes were proposed in this pull request?
In Spark 1.6 (with Hive support) we could use `CURRENT_DATE` and `CURRENT_TIMESTAMP` functions as literals (without adding braces), for example:
```SQL
select /* Spark 1.6: */ current_date, /* Spark 1.6  & Spark 2.0: */ current_date()
```
This was accidentally dropped in Spark 2.0. This PR reinstates this functionality.

## How was this patch tested?
Added a case to ExpressionParserSuite.

Author: Herman van Hovell <[email protected]>

Closes #14442 from hvanhovell/SPARK-16836.

(cherry picked from commit 2330f3e)
Signed-off-by: Reynold Xin <[email protected]>
@asfgit asfgit closed this in 2330f3e Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants