Skip to content

Conversation

@cloud-fan
Copy link
Contributor

We have nullSafeCodeGen to provide default code generation for binary and unary expression, and we can do the same thing for eval.

@AmplabJenkins
Copy link

Merged build triggered.

@cloud-fan
Copy link
Contributor Author

cc @rxin

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

2 similar comments
@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build started.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36255 has started for PR 7157 at commit 24cf8db.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36252 has started for PR 7157 at commit 070e2cb.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36256 has started for PR 7157 at commit ffa742c.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36255 has finished for PR 7157 at commit 24cf8db.

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

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36256 has finished for PR 7157 at commit ffa742c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class UnaryMinus(child: Expression) extends UnaryExpression
    • case class UnaryPositive(child: Expression) extends UnaryExpression
    • case class Abs(child: Expression) extends UnaryExpression
    • case class BitwiseNot(child: Expression) extends UnaryExpression
    • case class InSet(child: Expression, hset: Set[Any])
    • case class Contains(left: Expression, right: Expression) extends StringPredicate
    • case class StartsWith(left: Expression, right: Expression) extends StringPredicate
    • case class EndsWith(left: Expression, right: Expression) extends StringPredicate

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36252 has finished for PR 7157 at commit 070e2cb.

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

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@cloud-fan
Copy link
Contributor Author

waiting for #7175

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add scala doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add it during rebase, thanks for reminding!

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just leave it as unimplemented, so developer will notice that during coding, not runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There maybe exceptional cases that user need to override eval, at that time they don't need to implement nullSafeEval.

@chenghao-intel
Copy link
Contributor

Thank you for working on this @cloud-fan.This PR definitely will save the code, but I have some concerns on the interface updating, not about what you did in this PR, but in general:

  • Currently, too many callback functions need to implement when inherit from different abstract expression classes, it will be the barrier to who are new in the expression framework. From the SPI design princple point of view, we'd better keep the interface the simpler the better.
  • Default behavor is ok for most of cases, but there are always exceptional cases, expression developer needs more freedom.
  • It's not a big deal if we leave some duplicated code in expressions, as each of them are quite independent, that would be more straightforward for people to read / review it. (we don't want to jump back and forward while reading the code from web, right?)

@cloud-fan
Copy link
Contributor Author

hi @chenghao-intel , thanks for looking into this! I agree with your opinions, but have some other thoughts:

  • In this PR I added a new nullSafeEval for binary and unary expressions, with a default implementation: throw exception. So if new developers don't know this, it's OK for them to just override eval with some duplicated code. For someone is familiar with expression framework, they can use this shortcut to save code.
  • For exceptional cases, developers can still override eval and no need to care about nullSafeEval.
  • Duplicated code is not a big deal, but this pattern is so common and I think it's good to abstract it.

@AmplabJenkins
Copy link

Build triggered.

@AmplabJenkins
Copy link

Build started.

@SparkQA
Copy link

SparkQA commented Jul 6, 2015

Test build #36562 has started for PR 7157 at commit 2876cbd.

@SparkQA
Copy link

SparkQA commented Jul 6, 2015

Test build #36562 has finished for PR 7157 at commit 2876cbd.

  • This patch passes all tests.
  • This patch does not merge cleanly.
  • This patch adds the following public classes (experimental):
    • case class InSet(child: Expression, hset: Set[Any])
    • case class Decode(bin: Expression, charset: Expression)

@AmplabJenkins
Copy link

Build finished. Test PASSed.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@SparkQA
Copy link

SparkQA commented Jul 6, 2015

Test build #36571 has started for PR 7157 at commit a0a3b96.

@SparkQA
Copy link

SparkQA commented Jul 6, 2015

Test build #36571 has finished for PR 7157 at commit a0a3b96.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class InSet(child: Expression, hset: Set[Any])

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@cloud-fan
Copy link
Contributor Author

Hi @rxin , can you review it please? It's very easy to get conflict and I have to rebase it again and again...

Copy link
Contributor

Choose a reason for hiding this comment

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

can you update the javadoc above to include param doc for f, defining what the input / output is?

@rxin
Copy link
Contributor

rxin commented Jul 6, 2015

Looks good to me. Some comments about naming.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@SparkQA
Copy link

SparkQA commented Jul 7, 2015

Test build #36635 has started for PR 7157 at commit f3987c6.

@SparkQA
Copy link

SparkQA commented Jul 7, 2015

Test build #36635 has finished for PR 7157 at commit f3987c6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class InSet(child: Expression, hset: Set[Any])

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@rxin
Copy link
Contributor

rxin commented Jul 7, 2015

Thanks. I've merged this.

@asfgit asfgit closed this in c46aaf4 Jul 7, 2015
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