== 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#1769L]
Arguments: Range (2000000, 3000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#1769L % 250000) AS customer_id#1771L, concat(segment-, cast(cast((id#1769L % 12) as int) as string)) AS segment#1775, cast((id#1769L % 14) as int) AS processing_day#1777, ((cast(((id#1769L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#1779, cast((((id#1769L * 29) % 7) + 1) as int) AS events#1781]
Input [1]: [id#1769L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#1771L, segment#1775, processing_day#1777, amount#1779, events#1781, (amount#1779 * cast(events#1781 as double)) AS weighted_amount#1783]
Input [5]: [customer_id#1771L, segment#1775, processing_day#1777, amount#1779, events#1781]
(4) HashAggregate
Input [6]: [customer_id#1771L, segment#1775, processing_day#1777, amount#1779, events#1781, weighted_amount#1783]
Keys [2]: [segment#1775, processing_day#1777]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#1771L, 0.05, 0, 0), partial_sum(events#1781), partial_sum(weighted_amount#1783), partial_avg(amount#1779)]
Aggregate Attributes [57]: [count#2002L, MS[0]#1790L, MS[1]#1791L, MS[2]#1792L, MS[3]#1793L, MS[4]#1794L, MS[5]#1795L, MS[6]#1796L, MS[7]#1797L, MS[8]#1798L, MS[9]#1799L, MS[10]#1800L, MS[11]#1801L, MS[12]#1802L, MS[13]#1803L, MS[14]#1804L, MS[15]#1805L, MS[16]#1806L, MS[17]#1807L, MS[18]#1808L, MS[19]#1809L, MS[20]#1810L, MS[21]#1811L, MS[22]#1812L, MS[23]#1813L, MS[24]#1814L, MS[25]#1815L, MS[26]#1816L, MS[27]#1817L, MS[28]#1818L, MS[29]#1819L, MS[30]#1820L, MS[31]#1821L, MS[32]#1822L, MS[33]#1823L, MS[34]#1824L, MS[35]#1825L, MS[36]#1826L, MS[37]#1827L, MS[38]#1828L, MS[39]#1829L, MS[40]#1830L, MS[41]#1831L, MS[42]#1832L, MS[43]#1833L, MS[44]#1834L, MS[45]#1835L, MS[46]#1836L, MS[47]#1837L, MS[48]#1838L, MS[49]#1839L, MS[50]#1840L, MS[51]#1841L, sum#2003L, sum#2004, sum#2005, count#2006L]
Results [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
(5) Exchange
Input [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Arguments: hashpartitioning(segment#1775, processing_day#1777, 200), ENSURE_REQUIREMENTS, [plan_id=209]
(6) ShuffleQueryStage
Output [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Keys [2]: [segment#1775, processing_day#1777]
Functions [5]: [count(1), approx_count_distinct(customer_id#1771L, 0.05, 0, 0), sum(events#1781), sum(weighted_amount#1783), avg(amount#1779)]
Aggregate Attributes [5]: [count(1)#1789L, approx_count_distinct(customer_id#1771L, 0.05, 0, 0)#1894L, sum(events#1781)#1895L, sum(weighted_amount#1783)#1896, avg(amount#1779)#1897]
Results [7]: [segment#1775, processing_day#1777, count(1)#1789L AS row_count#1784L, approx_count_distinct(customer_id#1771L, 0.05, 0, 0)#1894L AS unique_customers#1785L, sum(events#1781)#1895L AS event_sum#1786L, sum(weighted_amount#1783)#1896 AS weighted_amount_sum#1787, avg(amount#1779)#1897 AS avg_amount#1788]
(9) Exchange
Input [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: rangepartitioning(segment#1775 ASC NULLS FIRST, processing_day#1777 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=231]
(10) ShuffleQueryStage
Output [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: [segment#1775 ASC NULLS FIRST, processing_day#1777 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#1771L, segment#1775, processing_day#1777, amount#1779, events#1781, weighted_amount#1783]
Keys [2]: [segment#1775, processing_day#1777]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#1771L, 0.05, 0, 0), partial_sum(events#1781), partial_sum(weighted_amount#1783), partial_avg(amount#1779)]
Aggregate Attributes [57]: [count#2002L, MS[0]#1790L, MS[1]#1791L, MS[2]#1792L, MS[3]#1793L, MS[4]#1794L, MS[5]#1795L, MS[6]#1796L, MS[7]#1797L, MS[8]#1798L, MS[9]#1799L, MS[10]#1800L, MS[11]#1801L, MS[12]#1802L, MS[13]#1803L, MS[14]#1804L, MS[15]#1805L, MS[16]#1806L, MS[17]#1807L, MS[18]#1808L, MS[19]#1809L, MS[20]#1810L, MS[21]#1811L, MS[22]#1812L, MS[23]#1813L, MS[24]#1814L, MS[25]#1815L, MS[26]#1816L, MS[27]#1817L, MS[28]#1818L, MS[29]#1819L, MS[30]#1820L, MS[31]#1821L, MS[32]#1822L, MS[33]#1823L, MS[34]#1824L, MS[35]#1825L, MS[36]#1826L, MS[37]#1827L, MS[38]#1828L, MS[39]#1829L, MS[40]#1830L, MS[41]#1831L, MS[42]#1832L, MS[43]#1833L, MS[44]#1834L, MS[45]#1835L, MS[46]#1836L, MS[47]#1837L, MS[48]#1838L, MS[49]#1839L, MS[50]#1840L, MS[51]#1841L, sum#2003L, sum#2004, sum#2005, count#2006L]
Results [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
(15) Exchange
Input [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Arguments: hashpartitioning(segment#1775, processing_day#1777, 200), ENSURE_REQUIREMENTS, [plan_id=189]
(16) HashAggregate
Input [59]: [segment#1775, processing_day#1777, count#2007L, MS[0]#1842L, MS[1]#1843L, MS[2]#1844L, MS[3]#1845L, MS[4]#1846L, MS[5]#1847L, MS[6]#1848L, MS[7]#1849L, MS[8]#1850L, MS[9]#1851L, MS[10]#1852L, MS[11]#1853L, MS[12]#1854L, MS[13]#1855L, MS[14]#1856L, MS[15]#1857L, MS[16]#1858L, MS[17]#1859L, MS[18]#1860L, MS[19]#1861L, MS[20]#1862L, MS[21]#1863L, MS[22]#1864L, MS[23]#1865L, MS[24]#1866L, MS[25]#1867L, MS[26]#1868L, MS[27]#1869L, MS[28]#1870L, MS[29]#1871L, MS[30]#1872L, MS[31]#1873L, MS[32]#1874L, MS[33]#1875L, MS[34]#1876L, MS[35]#1877L, MS[36]#1878L, MS[37]#1879L, MS[38]#1880L, MS[39]#1881L, MS[40]#1882L, MS[41]#1883L, MS[42]#1884L, MS[43]#1885L, MS[44]#1886L, MS[45]#1887L, MS[46]#1888L, MS[47]#1889L, MS[48]#1890L, MS[49]#1891L, MS[50]#1892L, MS[51]#1893L, sum#2008L, sum#2009, sum#2010, count#2011L]
Keys [2]: [segment#1775, processing_day#1777]
Functions [5]: [count(1), approx_count_distinct(customer_id#1771L, 0.05, 0, 0), sum(events#1781), sum(weighted_amount#1783), avg(amount#1779)]
Aggregate Attributes [5]: [count(1)#1789L, approx_count_distinct(customer_id#1771L, 0.05, 0, 0)#1894L, sum(events#1781)#1895L, sum(weighted_amount#1783)#1896, avg(amount#1779)#1897]
Results [7]: [segment#1775, processing_day#1777, count(1)#1789L AS row_count#1784L, approx_count_distinct(customer_id#1771L, 0.05, 0, 0)#1894L AS unique_customers#1785L, sum(events#1781)#1895L AS event_sum#1786L, sum(weighted_amount#1783)#1896 AS weighted_amount_sum#1787, avg(amount#1779)#1897 AS avg_amount#1788]
(17) Exchange
Input [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: rangepartitioning(segment#1775 ASC NULLS FIRST, processing_day#1777 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=192]
(18) Sort
Input [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: [segment#1775 ASC NULLS FIRST, processing_day#1777 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#1775, processing_day#1777, row_count#1784L, unique_customers#1785L, event_sum#1786L, weighted_amount_sum#1787, avg_amount#1788]
Arguments: isFinalPlan=true