cloud-fan commented on a change in pull request #22957: [SPARK-25951][SQL] 
Ignore aliases for distributions and orderings
URL: https://github.com/apache/spark/pull/22957#discussion_r255405132
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala
 ##########
 @@ -235,6 +241,14 @@ case class HashPartitioning(expressions: Seq[Expression], 
numPartitions: Int)
    * than numPartitions) based on hashing expressions.
    */
   def partitionIdExpression: Expression = Pmod(new Murmur3Hash(expressions), 
Literal(numPartitions))
+
+  override private[spark] def pruneInvalidAttribute(invalidAttr: Attribute): 
Partitioning = {
+    if (this.references.contains(invalidAttr)) {
+      UnknownPartitioning(numPartitions)
 
 Review comment:
   `HashPartitioning('a, 'b)` with output expressions `'a as 'a1`, should 
produce `UnknownPartitioning` or `HashPartitioning('a1)`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to