You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2015/12/01 23:38:28 UTC
[GitHub] spark pull request: [SPARK-11949][SQL] Check bitmasks to set nulla...
Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/10067#discussion_r46350803
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ---
@@ -223,10 +223,13 @@ class Analyzer(
case other => Alias(other, other.toString)()
}
- // TODO: We need to use bitmasks to determine which grouping expressions need to be
- // set as nullable. For example, if we have GROUPING SETS ((a,b), a), we do not need
- // to change the nullability of a.
- val attributeMap = groupByAliases.map(a => (a -> a.toAttribute.withNullability(true))).toMap
+ val attributeMap = groupByAliases.zipWithIndex.map { case (a, idx) =>
+ if (x.bitmasks.exists(bitmask => (bitmask & 1 << idx) == 0)) {
+ (a -> a.toAttribute.withNullability(true))
+ } else {
+ (a -> a.toAttribute)
+ }
+ }.toMap
--- End diff --
I think we did the same thing?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org