== 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#59299L]
Arguments: Range (19000000, 20000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#59299L % 250000) AS customer_id#59301L, concat(segment-, cast(cast((id#59299L % 12) as int) as string)) AS segment#59305, cast((id#59299L % 14) as int) AS processing_day#59307, ((cast(((id#59299L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#59309, cast((((id#59299L * 29) % 7) + 1) as int) AS events#59311]
Input [1]: [id#59299L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#59301L, segment#59305, processing_day#59307, amount#59309, events#59311, (amount#59309 * cast(events#59311 as double)) AS weighted_amount#59313]
Input [5]: [customer_id#59301L, segment#59305, processing_day#59307, amount#59309, events#59311]
(4) HashAggregate
Input [6]: [customer_id#59301L, segment#59305, processing_day#59307, amount#59309, events#59311, weighted_amount#59313]
Keys [2]: [segment#59305, processing_day#59307]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#59301L, 0.05, 0, 0), partial_sum(events#59311), partial_sum(weighted_amount#59313), partial_avg(amount#59309)]
Aggregate Attributes [57]: [count#59532L, MS[0]#59320L, MS[1]#59321L, MS[2]#59322L, MS[3]#59323L, MS[4]#59324L, MS[5]#59325L, MS[6]#59326L, MS[7]#59327L, MS[8]#59328L, MS[9]#59329L, MS[10]#59330L, MS[11]#59331L, MS[12]#59332L, MS[13]#59333L, MS[14]#59334L, MS[15]#59335L, MS[16]#59336L, MS[17]#59337L, MS[18]#59338L, MS[19]#59339L, MS[20]#59340L, MS[21]#59341L, MS[22]#59342L, MS[23]#59343L, MS[24]#59344L, MS[25]#59345L, MS[26]#59346L, MS[27]#59347L, MS[28]#59348L, MS[29]#59349L, MS[30]#59350L, MS[31]#59351L, MS[32]#59352L, MS[33]#59353L, MS[34]#59354L, MS[35]#59355L, MS[36]#59356L, MS[37]#59357L, MS[38]#59358L, MS[39]#59359L, MS[40]#59360L, MS[41]#59361L, MS[42]#59362L, MS[43]#59363L, MS[44]#59364L, MS[45]#59365L, MS[46]#59366L, MS[47]#59367L, MS[48]#59368L, MS[49]#59369L, MS[50]#59370L, MS[51]#59371L, sum#59533L, sum#59534, sum#59535, count#59536L]
Results [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
(5) Exchange
Input [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Arguments: hashpartitioning(segment#59305, processing_day#59307, 200), ENSURE_REQUIREMENTS, [plan_id=5616]
(6) ShuffleQueryStage
Output [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Keys [2]: [segment#59305, processing_day#59307]
Functions [5]: [count(1), approx_count_distinct(customer_id#59301L, 0.05, 0, 0), sum(events#59311), sum(weighted_amount#59313), avg(amount#59309)]
Aggregate Attributes [5]: [count(1)#59319L, approx_count_distinct(customer_id#59301L, 0.05, 0, 0)#59424L, sum(events#59311)#59425L, sum(weighted_amount#59313)#59426, avg(amount#59309)#59427]
Results [7]: [segment#59305, processing_day#59307, count(1)#59319L AS row_count#59314L, approx_count_distinct(customer_id#59301L, 0.05, 0, 0)#59424L AS unique_customers#59315L, sum(events#59311)#59425L AS event_sum#59316L, sum(weighted_amount#59313)#59426 AS weighted_amount_sum#59317, avg(amount#59309)#59427 AS avg_amount#59318]
(9) Exchange
Input [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: rangepartitioning(segment#59305 ASC NULLS FIRST, processing_day#59307 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5638]
(10) ShuffleQueryStage
Output [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: [segment#59305 ASC NULLS FIRST, processing_day#59307 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#59301L, segment#59305, processing_day#59307, amount#59309, events#59311, weighted_amount#59313]
Keys [2]: [segment#59305, processing_day#59307]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#59301L, 0.05, 0, 0), partial_sum(events#59311), partial_sum(weighted_amount#59313), partial_avg(amount#59309)]
Aggregate Attributes [57]: [count#59532L, MS[0]#59320L, MS[1]#59321L, MS[2]#59322L, MS[3]#59323L, MS[4]#59324L, MS[5]#59325L, MS[6]#59326L, MS[7]#59327L, MS[8]#59328L, MS[9]#59329L, MS[10]#59330L, MS[11]#59331L, MS[12]#59332L, MS[13]#59333L, MS[14]#59334L, MS[15]#59335L, MS[16]#59336L, MS[17]#59337L, MS[18]#59338L, MS[19]#59339L, MS[20]#59340L, MS[21]#59341L, MS[22]#59342L, MS[23]#59343L, MS[24]#59344L, MS[25]#59345L, MS[26]#59346L, MS[27]#59347L, MS[28]#59348L, MS[29]#59349L, MS[30]#59350L, MS[31]#59351L, MS[32]#59352L, MS[33]#59353L, MS[34]#59354L, MS[35]#59355L, MS[36]#59356L, MS[37]#59357L, MS[38]#59358L, MS[39]#59359L, MS[40]#59360L, MS[41]#59361L, MS[42]#59362L, MS[43]#59363L, MS[44]#59364L, MS[45]#59365L, MS[46]#59366L, MS[47]#59367L, MS[48]#59368L, MS[49]#59369L, MS[50]#59370L, MS[51]#59371L, sum#59533L, sum#59534, sum#59535, count#59536L]
Results [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
(15) Exchange
Input [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Arguments: hashpartitioning(segment#59305, processing_day#59307, 200), ENSURE_REQUIREMENTS, [plan_id=5596]
(16) HashAggregate
Input [59]: [segment#59305, processing_day#59307, count#59537L, MS[0]#59372L, MS[1]#59373L, MS[2]#59374L, MS[3]#59375L, MS[4]#59376L, MS[5]#59377L, MS[6]#59378L, MS[7]#59379L, MS[8]#59380L, MS[9]#59381L, MS[10]#59382L, MS[11]#59383L, MS[12]#59384L, MS[13]#59385L, MS[14]#59386L, MS[15]#59387L, MS[16]#59388L, MS[17]#59389L, MS[18]#59390L, MS[19]#59391L, MS[20]#59392L, MS[21]#59393L, MS[22]#59394L, MS[23]#59395L, MS[24]#59396L, MS[25]#59397L, MS[26]#59398L, MS[27]#59399L, MS[28]#59400L, MS[29]#59401L, MS[30]#59402L, MS[31]#59403L, MS[32]#59404L, MS[33]#59405L, MS[34]#59406L, MS[35]#59407L, MS[36]#59408L, MS[37]#59409L, MS[38]#59410L, MS[39]#59411L, MS[40]#59412L, MS[41]#59413L, MS[42]#59414L, MS[43]#59415L, MS[44]#59416L, MS[45]#59417L, MS[46]#59418L, MS[47]#59419L, MS[48]#59420L, MS[49]#59421L, MS[50]#59422L, MS[51]#59423L, sum#59538L, sum#59539, sum#59540, count#59541L]
Keys [2]: [segment#59305, processing_day#59307]
Functions [5]: [count(1), approx_count_distinct(customer_id#59301L, 0.05, 0, 0), sum(events#59311), sum(weighted_amount#59313), avg(amount#59309)]
Aggregate Attributes [5]: [count(1)#59319L, approx_count_distinct(customer_id#59301L, 0.05, 0, 0)#59424L, sum(events#59311)#59425L, sum(weighted_amount#59313)#59426, avg(amount#59309)#59427]
Results [7]: [segment#59305, processing_day#59307, count(1)#59319L AS row_count#59314L, approx_count_distinct(customer_id#59301L, 0.05, 0, 0)#59424L AS unique_customers#59315L, sum(events#59311)#59425L AS event_sum#59316L, sum(weighted_amount#59313)#59426 AS weighted_amount_sum#59317, avg(amount#59309)#59427 AS avg_amount#59318]
(17) Exchange
Input [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: rangepartitioning(segment#59305 ASC NULLS FIRST, processing_day#59307 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5599]
(18) Sort
Input [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: [segment#59305 ASC NULLS FIRST, processing_day#59307 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#59305, processing_day#59307, row_count#59314L, unique_customers#59315L, event_sum#59316L, weighted_amount_sum#59317, avg_amount#59318]
Arguments: isFinalPlan=true