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

WindowFrameCoercion

WindowFrameCoercion Type Coercion Logical Rule

Coercing Types in Logical Plan — coerceTypes Method

Note
coerceTypes is part of the TypeCoercionRule Contract to coerce types in a logical plan.

coerceTypes traverses all Catalyst expressions (in the input LogicalPlan) and replaces the frameSpecification of every WindowSpecDefinition with a RangeFrame window frame and the single order specification expression resolved with the lower and upper window frame boundary expressions cast to the data type of the order specification expression.

createBoundaryCast Internal Method

createBoundaryCast returns a Catalyst expression per the input boundary Expression and the dt DataType (in the order of execution):

  • The input boundary expression if it is a SpecialFrameBoundary

  • The input boundary expression if the dt data type is DateType or TimestampType

  • Cast unary operator with the input boundary expression and the dt data type if the result type of the boundary expression is not the dt data type, but the result type can be cast to the dt data type

  • The input boundary expression

Note
createBoundaryCast is used exclusively when WindowFrameCoercion type coercion logical rule is requested to coerceTypes.
赞(0) 打赏
未经允许不得转载:spark技术分享 » WindowFrameCoercion
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏