Skip to content

Conversation

@davies
Copy link
Contributor

@davies davies commented Jul 30, 2015

This PR is based on #6988 , thanks to @adrian-wang .

This brings two SQL functions: to_date() and trunc().

Closes #6988

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mistake, will rollback.

@SparkQA
Copy link

SparkQA commented Jul 30, 2015

Test build #39106 has finished for PR 7805 at commit 22a8d75.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class ToDate(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
    • case class TruncDate(date: Expression, format: Expression)

@davies davies force-pushed the to_date branch 2 times, most recently from b4dce35 to 2eae516 Compare July 30, 2015 22:01
Conflicts:
	sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
	sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeFunctions.scala
	sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
	sql/core/src/main/scala/org/apache/spark/sql/functions.scala
	sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala
@SparkQA
Copy link

SparkQA commented Jul 30, 2015

Test build #1244 has finished for PR 7805 at commit 22a8d75.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 30, 2015

Test build #1245 has finished for PR 7805 at commit 2eae516.

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

@SparkQA
Copy link

SparkQA commented Jul 30, 2015

Test build #39108 has finished for PR 7805 at commit 2c7beba.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class ToDate(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
    • case class TruncDate(date: Expression, format: Expression)

@davies
Copy link
Contributor Author

davies commented Jul 31, 2015

ping @rxin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny optimization - this can just call child.genCode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genCode is protected.

@rxin
Copy link
Contributor

rxin commented Jul 31, 2015

LGTM at the implementation. Just some minor comments.

I'm going to merge this. Can you address these comments in your next pr on expressions?

@asfgit asfgit closed this in 83670fc Jul 31, 2015
davies pushed a commit to davies/spark that referenced this pull request Jul 31, 2015
asfgit pushed a commit that referenced this pull request Jul 31, 2015
This PR address the comments in #7805

cc rxin

Author: Davies Liu <[email protected]>

Closes #7817 from davies/trunc and squashes the following commits:

f729d5f [Davies Liu] rollback
cb7f783 [Davies Liu] genCode() is protected
31e52ef [Davies Liu] fix style
ed1edc7 [Davies Liu] address comments for #7805
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.

4 participants