flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #3026: [FLINK-2980] [table] Support for GROUPING SETS cla...
Date Mon, 23 Jan 2017 14:13:13 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3026#discussion_r97312771
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/Expression.scala
---
    @@ -86,3 +85,44 @@ abstract class UnaryExpression extends Expression {
     abstract class LeafExpression extends Expression {
       private[flink] val children = Nil
     }
    +
    +class GroupedExpression(
    +    private[flink] val children: Seq[Expression]
    +  ) extends Expression {
    +
    +  def this(product: Product) {
    +    this(
    +      product.productIterator
    +        .map {
    +          case e: Expression => e
    +          case s: Symbol => UnresolvedFieldReference(s.name)
    +          case p: Product => new GroupedExpression(p)
    +          case _ => throw new IllegalArgumentException()
    +        }.toSeq
    +    )
    +  }
    +
    +  def flatChildren: Seq[Expression] = {
    +    children.flatMap {
    +      case g: GroupedExpression => g.flatChildren
    +      case x => Seq(x)
    +    }
    +  }
    +
    +  /**
    +    * Returns the [[TypeInformation]] for evaluating this expression.
    +    * It's not applicable for grouped expressions.
    +    */
    +  override private[flink] def resultType = ???
    +
    +  /**
    +    * Grouping function. Similar to a SQL GROUPING_ID function.
    +    */
    +  def groupingId(): Expression = GroupingId(children: _*)
    --- End diff --
    
    Remove this function as mentioned previously.


---
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.
---

Mime
View raw message