spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <>
Subject [GitHub] spark pull request: [SPARK-13658][SQL] BooleanSimplification rule ...
Date Mon, 14 Mar 2016 05:55:19 GMT
Github user rxin commented on a diff in the pull request:
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
    @@ -598,3 +601,61 @@ abstract class TernaryExpression extends Expression {
    + * Rewrites an expression using rules that are guaranteed preserve the result while attempting
    + * to remove cosmetic variations. Deterministic expressions that are `equal` after canonicalization
    + * will always return the same answer given the same input (i.e. false positives should
not be
    + * possible). However, it is possible that two canonical expressions that are not equal
will in fact
    + * return the same answer given any input (i.e. false negatives are possible).
    + *
    + * The following rules are applied:
    + *  - Names and nullability hints for [[org.apache.spark.sql.types.DataType]]s are stripped.
    + *  - Commutative and associative operations ([[Add]] and [[Multiply]]) have their children
    + *    by `hashCode`.
    +*   - [[EqualTo]] and [[EqualNullSafe]] are reordered by `hashCode`.
    + *  - Other comparisons ([[GreaterThan]], [[LessThan]]) are reversed by `hashCode`.
    + */
    +object Canonicalize extends {
    --- End diff --
    fwiw, if you are keeping this class, i think we should just have it in its own file. The
Expression.scala file is getting pretty long.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message