SelectWithUnionQuery (children 1) ExpressionList (children 1) SelectQuery (children 5) ExpressionList (children 2) Identifier k Function finalizeAggregation (children 1) ExpressionList (children 1) Function quantilesTimingState (children 2) ExpressionList (children 1) Identifier x ExpressionList (children 1) Literal Float64_0.5 TablesInSelectQuery (children 1) TablesInSelectQueryElement (children 1) TableExpression (children 1) Subquery (children 1) SelectWithUnionQuery (children 1) ExpressionList (children 1) SelectQuery (children 4) ExpressionList (children 1) Function toNullable (alias d) (children 1) ExpressionList (children 1) Function if (children 1) ExpressionList (children 3) Function equals (children 1) ExpressionList (children 2) Identifier number Literal UInt64_3 Literal UInt64_3 Literal UInt64_1 ExpressionList (children 2) Function intDiv (alias k) (children 1) ExpressionList (children 2) Identifier number Literal UInt64_3 Function modulo (alias x) (children 1) ExpressionList (children 2) Identifier number Identifier d TablesInSelectQuery (children 1) TablesInSelectQueryElement (children 1) TableExpression (children 1) TableIdentifier system.numbers Literal UInt64_100000 ExpressionList (children 1) Identifier k ExpressionList (children 1) OrderByElement (children 1) Identifier k Literal UInt64_5