== Physical Plan ==
AdaptiveSparkPlan (19)
+- == Final Plan ==
ResultQueryStage (13), Statistics(sizeInBytes=8.0 EiB)
+- * Sort (12)
+- AQEShuffleRead (11)
+- ShuffleQueryStage (10), Statistics(sizeInBytes=6.6 KiB, rowCount=84)
+- Exchange (9)
+- HashAggregate (8)
+- AQEShuffleRead (7)
+- ShuffleQueryStage (6), Statistics(sizeInBytes=976.5 KiB, rowCount=2.02E+3)
+- Exchange (5)
+- HashAggregate (4)
+- * Project (3)
+- * Project (2)
+- * Range (1)
+- == Initial Plan ==
Sort (18)
+- Exchange (17)
+- HashAggregate (16)
+- Exchange (15)
+- HashAggregate (14)
+- Project (3)
+- Project (2)
+- Range (1)
(1) Range [codegen id : 1]
Output [1]: [id#67289L]
Arguments: Range (4000000, 5000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#67289L % 250000) AS customer_id#67291L, concat(segment-, cast(cast((id#67289L % 12) as int) as string)) AS segment#67295, cast((id#67289L % 14) as int) AS processing_day#67297, ((cast(((id#67289L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#67299, cast((((id#67289L * 29) % 7) + 1) as int) AS events#67301]
Input [1]: [id#67289L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#67291L, segment#67295, processing_day#67297, amount#67299, events#67301, (amount#67299 * cast(events#67301 as double)) AS weighted_amount#67303]
Input [5]: [customer_id#67291L, segment#67295, processing_day#67297, amount#67299, events#67301]
(4) HashAggregate
Input [6]: [customer_id#67291L, segment#67295, processing_day#67297, amount#67299, events#67301, weighted_amount#67303]
Keys [2]: [segment#67295, processing_day#67297]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#67291L, 0.05, 0, 0), partial_sum(events#67301), partial_sum(weighted_amount#67303), partial_avg(amount#67299)]
Aggregate Attributes [57]: [count#67522L, MS[0]#67310L, MS[1]#67311L, MS[2]#67312L, MS[3]#67313L, MS[4]#67314L, MS[5]#67315L, MS[6]#67316L, MS[7]#67317L, MS[8]#67318L, MS[9]#67319L, MS[10]#67320L, MS[11]#67321L, MS[12]#67322L, MS[13]#67323L, MS[14]#67324L, MS[15]#67325L, MS[16]#67326L, MS[17]#67327L, MS[18]#67328L, MS[19]#67329L, MS[20]#67330L, MS[21]#67331L, MS[22]#67332L, MS[23]#67333L, MS[24]#67334L, MS[25]#67335L, MS[26]#67336L, MS[27]#67337L, MS[28]#67338L, MS[29]#67339L, MS[30]#67340L, MS[31]#67341L, MS[32]#67342L, MS[33]#67343L, MS[34]#67344L, MS[35]#67345L, MS[36]#67346L, MS[37]#67347L, MS[38]#67348L, MS[39]#67349L, MS[40]#67350L, MS[41]#67351L, MS[42]#67352L, MS[43]#67353L, MS[44]#67354L, MS[45]#67355L, MS[46]#67356L, MS[47]#67357L, MS[48]#67358L, MS[49]#67359L, MS[50]#67360L, MS[51]#67361L, sum#67523L, sum#67524, sum#67525, count#67526L]
Results [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
(5) Exchange
Input [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Arguments: hashpartitioning(segment#67295, processing_day#67297, 200), ENSURE_REQUIREMENTS, [plan_id=6369]
(6) ShuffleQueryStage
Output [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Keys [2]: [segment#67295, processing_day#67297]
Functions [5]: [count(1), approx_count_distinct(customer_id#67291L, 0.05, 0, 0), sum(events#67301), sum(weighted_amount#67303), avg(amount#67299)]
Aggregate Attributes [5]: [count(1)#67309L, approx_count_distinct(customer_id#67291L, 0.05, 0, 0)#67414L, sum(events#67301)#67415L, sum(weighted_amount#67303)#67416, avg(amount#67299)#67417]
Results [7]: [segment#67295, processing_day#67297, count(1)#67309L AS row_count#67304L, approx_count_distinct(customer_id#67291L, 0.05, 0, 0)#67414L AS unique_customers#67305L, sum(events#67301)#67415L AS event_sum#67306L, sum(weighted_amount#67303)#67416 AS weighted_amount_sum#67307, avg(amount#67299)#67417 AS avg_amount#67308]
(9) Exchange
Input [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: rangepartitioning(segment#67295 ASC NULLS FIRST, processing_day#67297 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6391]
(10) ShuffleQueryStage
Output [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: [segment#67295 ASC NULLS FIRST, processing_day#67297 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#67291L, segment#67295, processing_day#67297, amount#67299, events#67301, weighted_amount#67303]
Keys [2]: [segment#67295, processing_day#67297]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#67291L, 0.05, 0, 0), partial_sum(events#67301), partial_sum(weighted_amount#67303), partial_avg(amount#67299)]
Aggregate Attributes [57]: [count#67522L, MS[0]#67310L, MS[1]#67311L, MS[2]#67312L, MS[3]#67313L, MS[4]#67314L, MS[5]#67315L, MS[6]#67316L, MS[7]#67317L, MS[8]#67318L, MS[9]#67319L, MS[10]#67320L, MS[11]#67321L, MS[12]#67322L, MS[13]#67323L, MS[14]#67324L, MS[15]#67325L, MS[16]#67326L, MS[17]#67327L, MS[18]#67328L, MS[19]#67329L, MS[20]#67330L, MS[21]#67331L, MS[22]#67332L, MS[23]#67333L, MS[24]#67334L, MS[25]#67335L, MS[26]#67336L, MS[27]#67337L, MS[28]#67338L, MS[29]#67339L, MS[30]#67340L, MS[31]#67341L, MS[32]#67342L, MS[33]#67343L, MS[34]#67344L, MS[35]#67345L, MS[36]#67346L, MS[37]#67347L, MS[38]#67348L, MS[39]#67349L, MS[40]#67350L, MS[41]#67351L, MS[42]#67352L, MS[43]#67353L, MS[44]#67354L, MS[45]#67355L, MS[46]#67356L, MS[47]#67357L, MS[48]#67358L, MS[49]#67359L, MS[50]#67360L, MS[51]#67361L, sum#67523L, sum#67524, sum#67525, count#67526L]
Results [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
(15) Exchange
Input [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Arguments: hashpartitioning(segment#67295, processing_day#67297, 200), ENSURE_REQUIREMENTS, [plan_id=6349]
(16) HashAggregate
Input [59]: [segment#67295, processing_day#67297, count#67527L, MS[0]#67362L, MS[1]#67363L, MS[2]#67364L, MS[3]#67365L, MS[4]#67366L, MS[5]#67367L, MS[6]#67368L, MS[7]#67369L, MS[8]#67370L, MS[9]#67371L, MS[10]#67372L, MS[11]#67373L, MS[12]#67374L, MS[13]#67375L, MS[14]#67376L, MS[15]#67377L, MS[16]#67378L, MS[17]#67379L, MS[18]#67380L, MS[19]#67381L, MS[20]#67382L, MS[21]#67383L, MS[22]#67384L, MS[23]#67385L, MS[24]#67386L, MS[25]#67387L, MS[26]#67388L, MS[27]#67389L, MS[28]#67390L, MS[29]#67391L, MS[30]#67392L, MS[31]#67393L, MS[32]#67394L, MS[33]#67395L, MS[34]#67396L, MS[35]#67397L, MS[36]#67398L, MS[37]#67399L, MS[38]#67400L, MS[39]#67401L, MS[40]#67402L, MS[41]#67403L, MS[42]#67404L, MS[43]#67405L, MS[44]#67406L, MS[45]#67407L, MS[46]#67408L, MS[47]#67409L, MS[48]#67410L, MS[49]#67411L, MS[50]#67412L, MS[51]#67413L, sum#67528L, sum#67529, sum#67530, count#67531L]
Keys [2]: [segment#67295, processing_day#67297]
Functions [5]: [count(1), approx_count_distinct(customer_id#67291L, 0.05, 0, 0), sum(events#67301), sum(weighted_amount#67303), avg(amount#67299)]
Aggregate Attributes [5]: [count(1)#67309L, approx_count_distinct(customer_id#67291L, 0.05, 0, 0)#67414L, sum(events#67301)#67415L, sum(weighted_amount#67303)#67416, avg(amount#67299)#67417]
Results [7]: [segment#67295, processing_day#67297, count(1)#67309L AS row_count#67304L, approx_count_distinct(customer_id#67291L, 0.05, 0, 0)#67414L AS unique_customers#67305L, sum(events#67301)#67415L AS event_sum#67306L, sum(weighted_amount#67303)#67416 AS weighted_amount_sum#67307, avg(amount#67299)#67417 AS avg_amount#67308]
(17) Exchange
Input [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: rangepartitioning(segment#67295 ASC NULLS FIRST, processing_day#67297 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6352]
(18) Sort
Input [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: [segment#67295 ASC NULLS FIRST, processing_day#67297 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#67295, processing_day#67297, row_count#67304L, unique_customers#67305L, event_sum#67306L, weighted_amount_sum#67307, avg_amount#67308]
Arguments: isFinalPlan=true