Skip to content

[SPARK-3176] Implement 'ABS and 'LAST' for sql #2099

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

Closed
wants to merge 6 commits into from

Conversation

xinyunh
Copy link

@xinyunh xinyunh commented Aug 22, 2014

Add support for the mathematical function"ABS" and the analytic function "last" to return a subset of the rows satisfying a query within spark sql. Test-cases included.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

}

override def eval(input: Row): Any = if (result != null) expr.eval(result.asInstanceOf[Row]) else null
}
Copy link
Contributor

Choose a reason for hiding this comment

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

End files with new lines. (Run sbt/sbt scalastyle to check for these types of style violations).

Copy link
Author

Choose a reason for hiding this comment

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

Ok. BTW, need I create a new pull request? Or just updating this branch?

Copy link
Contributor

Choose a reason for hiding this comment

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

Updating the branch will automatically include new commits in this pull request.

@marmbrus
Copy link
Contributor

Thanks for working on this! I made a few comments on the implementation.

@xinyunh
Copy link
Author

xinyunh commented Aug 29, 2014

I have made some changes according to the comments.

@marmbrus
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Aug 30, 2014

QA tests have started for PR 2099 at commit 39f0309.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Aug 30, 2014

QA tests have finished for PR 2099 at commit 39f0309.

  • This patch fails unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Last(child: Expression) extends PartialAggregate with trees.UnaryNode[Expression]
    • case class LastFunction(expr: Expression, base: AggregateExpression) extends AggregateFunction
    • case class Abs(child: Expression) extends UnaryExpression
    • case class Power(base: Expression, exponent: Expression) extends Expression

@xinyunh
Copy link
Author

xinyunh commented Sep 2, 2014

May I know in which test cases do we failed?

@nchammas
Copy link
Contributor

nchammas commented Sep 2, 2014

The link to the test results is in Spark QA's latest message: "QA tests have finished"

It looks like you have a Scala style problem. You can run tests locally by running ./dev/run-tests to check for these things before Spark QA gets to them.

@xinyunh
Copy link
Author

xinyunh commented Sep 2, 2014

Thank you! Fixed this code style issue.

@SparkQA
Copy link

SparkQA commented Sep 2, 2014

QA tests have started for PR 2099 at commit 8843643.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 2, 2014

QA tests have finished for PR 2099 at commit 8843643.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Last(child: Expression) extends PartialAggregate with trees.UnaryNode[Expression]
    • case class LastFunction(expr: Expression, base: AggregateExpression) extends AggregateFunction
    • case class Abs(child: Expression) extends UnaryExpression
    • case class Power(base: Expression, exponent: Expression) extends Expression

@marmbrus
Copy link
Contributor

marmbrus commented Sep 3, 2014

The implementation of Last and Abs look great to me. I think we could merge them now. Regarding power, I'm concerned that we aren't handling all of the various cases (i.e. what about Decimal?). What do you think about splitting that off into its own PR?

@xinyunh
Copy link
Author

xinyunh commented Sep 3, 2014

OK. Thus, I should remove the POWER part from this pull request and create another pull request which includes the POWER, correct? Need I also split the issue on Jira?

@marmbrus
Copy link
Contributor

marmbrus commented Sep 3, 2014

Yes please. We try to keep one JIRA to one PR in generall.

@xinyunh
Copy link
Author

xinyunh commented Sep 3, 2014

I have split the POWER to PR #2252, Jira number is 3379

@SparkQA
Copy link

SparkQA commented Sep 3, 2014

QA tests have started for PR 2099 at commit 71d15e7.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 3, 2014

QA tests have finished for PR 2099 at commit 71d15e7.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Last(child: Expression) extends PartialAggregate with trees.UnaryNode[Expression]
    • case class LastFunction(expr: Expression, base: AggregateExpression) extends AggregateFunction
    • case class Abs(child: Expression) extends UnaryExpression

@marmbrus
Copy link
Contributor

marmbrus commented Sep 5, 2014

Mind fixing the title to remove Power?

@xinyunh xinyunh changed the title [SPARK-3176] Implement 'POWER', 'ABS and 'LAST' for sql [SPARK-3176] Implement 'ABS and 'LAST' for sql Sep 5, 2014
@xinyunh
Copy link
Author

xinyunh commented Sep 5, 2014

Sorry, I forgot

@SparkQA
Copy link

SparkQA commented Sep 5, 2014

Can one of the admins verify this patch?

@marmbrus
Copy link
Contributor

marmbrus commented Sep 9, 2014

Mind fixing the conflict so we can merge this? Thanks!

@marmbrus
Copy link
Contributor

marmbrus commented Sep 9, 2014

ok to test

@SparkQA
Copy link

SparkQA commented Sep 9, 2014

QA tests have started for PR 2099 at commit 71d15e7.

  • This patch does not merge cleanly!

@SparkQA
Copy link

SparkQA commented Sep 9, 2014

QA tests have finished for PR 2099 at commit 71d15e7.

  • This patch fails unit tests.
  • This patch does not merge cleanly!

@xinyunh
Copy link
Author

xinyunh commented Sep 9, 2014

Why it fails while I only changed the name of title?

@asfgit asfgit closed this in 07ee4a2 Sep 10, 2014
@marmbrus
Copy link
Contributor

The test failure was unrelated. I resolved the conflict and tested locally. Merged to master. Thanks!

@bomeng bomeng deleted the sqlTest branch January 22, 2015 19:25
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