== 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#885L]
Arguments: Range (1000000, 2000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#885L % 250000) AS customer_id#887L, concat(segment-, cast(cast((id#885L % 12) as int) as string)) AS segment#891, cast((id#885L % 14) as int) AS processing_day#893, ((cast(((id#885L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#895, cast((((id#885L * 29) % 7) + 1) as int) AS events#897]
Input [1]: [id#885L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#887L, segment#891, processing_day#893, amount#895, events#897, (amount#895 * cast(events#897 as double)) AS weighted_amount#899]
Input [5]: [customer_id#887L, segment#891, processing_day#893, amount#895, events#897]
(4) HashAggregate
Input [6]: [customer_id#887L, segment#891, processing_day#893, amount#895, events#897, weighted_amount#899]
Keys [2]: [segment#891, processing_day#893]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#887L, 0.05, 0, 0), partial_sum(events#897), partial_sum(weighted_amount#899), partial_avg(amount#895)]
Aggregate Attributes [57]: [count#1118L, MS[0]#906L, MS[1]#907L, MS[2]#908L, MS[3]#909L, MS[4]#910L, MS[5]#911L, MS[6]#912L, MS[7]#913L, MS[8]#914L, MS[9]#915L, MS[10]#916L, MS[11]#917L, MS[12]#918L, MS[13]#919L, MS[14]#920L, MS[15]#921L, MS[16]#922L, MS[17]#923L, MS[18]#924L, MS[19]#925L, MS[20]#926L, MS[21]#927L, MS[22]#928L, MS[23]#929L, MS[24]#930L, MS[25]#931L, MS[26]#932L, MS[27]#933L, MS[28]#934L, MS[29]#935L, MS[30]#936L, MS[31]#937L, MS[32]#938L, MS[33]#939L, MS[34]#940L, MS[35]#941L, MS[36]#942L, MS[37]#943L, MS[38]#944L, MS[39]#945L, MS[40]#946L, MS[41]#947L, MS[42]#948L, MS[43]#949L, MS[44]#950L, MS[45]#951L, MS[46]#952L, MS[47]#953L, MS[48]#954L, MS[49]#955L, MS[50]#956L, MS[51]#957L, sum#1119L, sum#1120, sum#1121, count#1122L]
Results [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
(5) Exchange
Input [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Arguments: hashpartitioning(segment#891, processing_day#893, 200), ENSURE_REQUIREMENTS, [plan_id=126]
(6) ShuffleQueryStage
Output [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Keys [2]: [segment#891, processing_day#893]
Functions [5]: [count(1), approx_count_distinct(customer_id#887L, 0.05, 0, 0), sum(events#897), sum(weighted_amount#899), avg(amount#895)]
Aggregate Attributes [5]: [count(1)#905L, approx_count_distinct(customer_id#887L, 0.05, 0, 0)#1010L, sum(events#897)#1011L, sum(weighted_amount#899)#1012, avg(amount#895)#1013]
Results [7]: [segment#891, processing_day#893, count(1)#905L AS row_count#900L, approx_count_distinct(customer_id#887L, 0.05, 0, 0)#1010L AS unique_customers#901L, sum(events#897)#1011L AS event_sum#902L, sum(weighted_amount#899)#1012 AS weighted_amount_sum#903, avg(amount#895)#1013 AS avg_amount#904]
(9) Exchange
Input [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: rangepartitioning(segment#891 ASC NULLS FIRST, processing_day#893 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=148]
(10) ShuffleQueryStage
Output [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: [segment#891 ASC NULLS FIRST, processing_day#893 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#887L, segment#891, processing_day#893, amount#895, events#897, weighted_amount#899]
Keys [2]: [segment#891, processing_day#893]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#887L, 0.05, 0, 0), partial_sum(events#897), partial_sum(weighted_amount#899), partial_avg(amount#895)]
Aggregate Attributes [57]: [count#1118L, MS[0]#906L, MS[1]#907L, MS[2]#908L, MS[3]#909L, MS[4]#910L, MS[5]#911L, MS[6]#912L, MS[7]#913L, MS[8]#914L, MS[9]#915L, MS[10]#916L, MS[11]#917L, MS[12]#918L, MS[13]#919L, MS[14]#920L, MS[15]#921L, MS[16]#922L, MS[17]#923L, MS[18]#924L, MS[19]#925L, MS[20]#926L, MS[21]#927L, MS[22]#928L, MS[23]#929L, MS[24]#930L, MS[25]#931L, MS[26]#932L, MS[27]#933L, MS[28]#934L, MS[29]#935L, MS[30]#936L, MS[31]#937L, MS[32]#938L, MS[33]#939L, MS[34]#940L, MS[35]#941L, MS[36]#942L, MS[37]#943L, MS[38]#944L, MS[39]#945L, MS[40]#946L, MS[41]#947L, MS[42]#948L, MS[43]#949L, MS[44]#950L, MS[45]#951L, MS[46]#952L, MS[47]#953L, MS[48]#954L, MS[49]#955L, MS[50]#956L, MS[51]#957L, sum#1119L, sum#1120, sum#1121, count#1122L]
Results [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
(15) Exchange
Input [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Arguments: hashpartitioning(segment#891, processing_day#893, 200), ENSURE_REQUIREMENTS, [plan_id=106]
(16) HashAggregate
Input [59]: [segment#891, processing_day#893, count#1123L, MS[0]#958L, MS[1]#959L, MS[2]#960L, MS[3]#961L, MS[4]#962L, MS[5]#963L, MS[6]#964L, MS[7]#965L, MS[8]#966L, MS[9]#967L, MS[10]#968L, MS[11]#969L, MS[12]#970L, MS[13]#971L, MS[14]#972L, MS[15]#973L, MS[16]#974L, MS[17]#975L, MS[18]#976L, MS[19]#977L, MS[20]#978L, MS[21]#979L, MS[22]#980L, MS[23]#981L, MS[24]#982L, MS[25]#983L, MS[26]#984L, MS[27]#985L, MS[28]#986L, MS[29]#987L, MS[30]#988L, MS[31]#989L, MS[32]#990L, MS[33]#991L, MS[34]#992L, MS[35]#993L, MS[36]#994L, MS[37]#995L, MS[38]#996L, MS[39]#997L, MS[40]#998L, MS[41]#999L, MS[42]#1000L, MS[43]#1001L, MS[44]#1002L, MS[45]#1003L, MS[46]#1004L, MS[47]#1005L, MS[48]#1006L, MS[49]#1007L, MS[50]#1008L, MS[51]#1009L, sum#1124L, sum#1125, sum#1126, count#1127L]
Keys [2]: [segment#891, processing_day#893]
Functions [5]: [count(1), approx_count_distinct(customer_id#887L, 0.05, 0, 0), sum(events#897), sum(weighted_amount#899), avg(amount#895)]
Aggregate Attributes [5]: [count(1)#905L, approx_count_distinct(customer_id#887L, 0.05, 0, 0)#1010L, sum(events#897)#1011L, sum(weighted_amount#899)#1012, avg(amount#895)#1013]
Results [7]: [segment#891, processing_day#893, count(1)#905L AS row_count#900L, approx_count_distinct(customer_id#887L, 0.05, 0, 0)#1010L AS unique_customers#901L, sum(events#897)#1011L AS event_sum#902L, sum(weighted_amount#899)#1012 AS weighted_amount_sum#903, avg(amount#895)#1013 AS avg_amount#904]
(17) Exchange
Input [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: rangepartitioning(segment#891 ASC NULLS FIRST, processing_day#893 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=109]
(18) Sort
Input [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: [segment#891 ASC NULLS FIRST, processing_day#893 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#891, processing_day#893, row_count#900L, unique_customers#901L, event_sum#902L, weighted_amount_sum#903, avg_amount#904]
Arguments: isFinalPlan=true