Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-23905][SQL] Add UDF weekday #21009

Closed
wants to merge 2 commits into from
Closed

Conversation

yucai
Copy link
Contributor

@yucai yucai commented Apr 9, 2018

What changes were proposed in this pull request?

Add UDF weekday

How was this patch tested?

A new test

@jerryshao
Copy link
Contributor

Jenkins, add to whitelist.

@jerryshao
Copy link
Contributor

Jenkins, test this please.

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

LGTM

@SparkQA
Copy link

SparkQA commented Apr 10, 2018

Test build #89081 has finished for PR 21009 at commit 79beb00.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DayOfWeek(child: Expression) extends DayWeek
  • case class WeekDay(child: Expression) extends DayWeek
  • abstract class DayWeek extends UnaryExpression with ImplicitCastInputTypes


override def dataType: DataType = IntegerType

@transient protected lazy val c: Calendar = {
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe calendar instead of just c.

@transient private lazy val c = {
Calendar.getInstance(DateTimeUtils.getTimeZone("UTC"))
}
case class DayOfWeek(child: Expression) extends DayWeek {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like DayOfWeek is duplicate to WeekDay, do we have plan to deprecate DayOfWeek in maybe 3.0?

Copy link
Member

Choose a reason for hiding this comment

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

They are not duplicate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are different, see:
WeekDay: 0 = Monday, 1 = Tuesday, … 6 = Sunday
DayOfWeek: 1 = Sunday, 2 = Monday, ..., 7 = Saturday

@yucai
Copy link
Contributor Author

yucai commented Apr 10, 2018

Jenkins, retest this please

@SparkQA
Copy link

SparkQA commented Apr 10, 2018

Test build #89137 has finished for PR 21009 at commit 2b5db56.

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

@SparkQA
Copy link

SparkQA commented Apr 10, 2018

Test build #89138 has finished for PR 21009 at commit 2b5db56.

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

@yucai
Copy link
Contributor Author

yucai commented Apr 11, 2018

I did the local testing, all pass.

@yucai
Copy link
Contributor Author

yucai commented Apr 11, 2018

Jenkins, retest this please

@SparkQA
Copy link

SparkQA commented Apr 11, 2018

Test build #89161 has finished for PR 21009 at commit 2b5db56.

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

@SparkQA
Copy link

SparkQA commented Apr 11, 2018

Test build #89181 has finished for PR 21009 at commit 79beb00.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DayOfWeek(child: Expression) extends DayWeek
  • case class WeekDay(child: Expression) extends DayWeek
  • abstract class DayWeek extends UnaryExpression with ImplicitCastInputTypes

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

change itself seems fine.

@SparkQA
Copy link

SparkQA commented Apr 12, 2018

Test build #89229 has finished for PR 21009 at commit 363ff1c.

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

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Apr 12, 2018

Test build #89235 has finished for PR 21009 at commit 363ff1c.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 12, 2018

Test build #89242 has finished for PR 21009 at commit 4068289.

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

@gatorsmile
Copy link
Member

Thanks! Merged to master.

@asfgit asfgit closed this in 0323e61 Apr 13, 2018
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.

6 participants