关注 spark技术分享,
撸spark源码 玩spark最佳实践

GroupingSets

GroupingSets Unary Logical Operator

GroupingSets is a unary logical operator that represents SQL’s GROUPING SETS variant of GROUP BY clause.

GroupingSets operator is resolved to an Aggregate logical operator at analysis phase.

Note
GroupingSets can only be created using SQL.
Note
GroupingSets is not supported on Structured Streaming’s streaming Datasets.

GroupingSets is never resolved (as it can only be converted to an Aggregate logical operator).

The output schema of a GroupingSets are exactly the attributes of aggregate named expressions.

Analysis Phase

GroupingSets operator is resolved at analysis phase in the following logical evaluation rules:

GroupingSets operator is resolved to an Aggregate with Expand logical operators.

Creating GroupingSets Instance

GroupingSets takes the following when created:

赞(0) 打赏
未经允许不得转载:spark技术分享 » GroupingSets
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏