{"id":373520,"date":"2024-05-21T05:38:11","date_gmt":"2024-05-21T05:38:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=373520"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=373520","title":{"rendered":"<span>Spark. \u041f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0430\u0440\u0443 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043f\u043b\u0430\u043d\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0439: \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0434\u043e \u0434\u0436\u043e\u0439\u043d\u043e\u0432, \u043e\u043a\u043e\u043d\u043e\u043a \u0438 \u0440\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0438\u0434\u044b \u043f\u043b\u0430\u043d\u043e\u0432 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 3 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>campaigns \u2013 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u043f\u043e\u043b\u044e loading_id<\/p>\n<\/li>\n<li>\n<p>campaigns_not_partitioned \u2013 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u043e \u043d\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>stats \u2013 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0442\u044c \u0434\u0436\u043e\u0439\u043d\u044b<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/c85\/7b1\/2a1\/c857b12a10d36c000026597c9a065ac6.jpg\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 campaigns \/ campaigns_not_partitioned\" title=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 campaigns \/ campaigns_not_partitioned\" width=\"1114\" height=\"218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c85\/7b1\/2a1\/c857b12a10d36c000026597c9a065ac6.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f82\/6a7\/5d2\/f826a75d25761c75d32959a84bb33c33.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned\" width=\"406\" height=\"300\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f82\/6a7\/5d2\/f826a75d25761c75d32959a84bb33c33.png\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f02\/e29\/f4e\/f02e29f4e9f75220729f82b9787324a8.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned\" width=\"268\" height=\"205\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f02\/e29\/f4e\/f02e29f4e9f75220729f82b9787324a8.png\"\/><\/p>\n<div><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 stats<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/836\/33e\/139\/83633e1394c5bf82a46daf540549d367.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b stats\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b stats\" width=\"358\" height=\"132\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/836\/33e\/139\/83633e1394c5bf82a46daf540549d367.png\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b stats<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043f\u0440\u043e \u0432\u0438\u0434\u044b \u043f\u043b\u0430\u043d\u043e\u0432<\/h2>\n<p>\u0412\u0441\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 4 \u043f\u043b\u0430\u043d\u0430:<\/p>\n<ol>\n<li>\n<p>Parsed Logical Plan \u2013 \u043f\u043b\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u043a\u043e\u0434\u043e\u043c, \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>Analyzed Logical Plan \u2013 \u043f\u043b\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>Optimized Logical Plan \u2013 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u043b\u0430\u043d\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>Physical Plan \u2013 \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u0438\u043a\u0438, \u043f\u0443\u0442\u0438, \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b0c\/92a\/01f\/b0c92a01fa76035571d4882bf0dd130b.png\" alt=\"\u041f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns\" title=\"\u041f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns\" width=\"1120\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b0c\/92a\/01f\/b0c92a01fa76035571d4882bf0dd130b.png\"\/><\/p>\n<div><figcaption>\u041f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u043d, \u0442.\u043a. \u043e\u043d \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0427\u0442\u043e\u0431\u044b \u0447\u0442\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u044b\u043c, \u0435\u0441\u0442\u044c \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u0441\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<br \/>\u041f\u043e\u0433\u043d\u0430\u043b\u0438!<\/p>\n<p><a class=\"anchor\" name=\"start\" id=\"start\"><\/a><\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ol>\n<li>\n<p><a href=\"#1\" rel=\"noopener noreferrer nofollow\">\u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\" rel=\"noopener noreferrer nofollow\">\u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#4\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 + \u0444\u0438\u043b\u044c\u0442\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\" rel=\"noopener noreferrer nofollow\">\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#6\" rel=\"noopener noreferrer nofollow\">\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#7\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#8\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#9\" rel=\"noopener noreferrer nofollow\">Distinct<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#10\" rel=\"noopener noreferrer nofollow\">Sort<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#11\" rel=\"noopener noreferrer nofollow\">\u0410\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#12\" rel=\"noopener noreferrer nofollow\">DropDuplicates<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#13\" rel=\"noopener noreferrer nofollow\">Window functions<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#14\" rel=\"noopener noreferrer nofollow\">Union<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#15\" rel=\"noopener noreferrer nofollow\">Join<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#16\" rel=\"noopener noreferrer nofollow\">Repartition<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#17\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h2>1. \u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd6\/ffd\/cd9\/cd6ffdcd9390db4bd24c956b3c356326.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns\" width=\"1128\" height=\"192\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd6\/ffd\/cd9\/cd6ffdcd9390db4bd24c956b3c356326.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0436, \u043f\u043e\u0439\u0434\u0435\u043c\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043f\u043b\u0430\u043d:<\/p>\n<p><strong>1) FileScan parquet<\/strong><br \/>\u041d\u0430\u0448\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0445\u0435\u043c\u044b, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u043f\u0430\u0440\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 hdfs \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043d\u0435\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435), \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043d\u0435\u0442, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><strong>2) ColumnarToRow<br \/><\/strong>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u043a\u0435\u0442-\u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u043e, \u043d\u043e \u0432 \u0441\u043f\u0430\u0440\u043a\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0431\u044b\u043b\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e \u043f\u043e\u043b\u044e loading_id. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5b\/04e\/914\/d5b04e9149f2809822b32f993cf7a68e.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned\" width=\"1132\" height=\"192\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5b\/04e\/914\/d5b04e9149f2809822b32f993cf7a68e.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c?<br \/>Location \u0432\u043c\u0435\u0441\u0442\u043e <strong>CatalogFileIndex<\/strong> \u0441\u0442\u0430\u043b <strong>InMemoryFileIndex<\/strong>.<br \/><strong>CatalogFileIndex<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<br \/><strong>InMemoryFileIndex<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>2. \u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5f8\/4b0\/af4\/5f84b0af458e0a02426560aa1e672073.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" width=\"1128\" height=\"193\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f8\/4b0\/af4\/5f84b0af458e0a02426560aa1e672073.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0435 <strong>PartitionFilters<\/strong> \u2013 \u043c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u0412\u043e\u043e\u0431\u0449\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 Catalyst \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u2013 <strong>isnotnull<\/strong>, \u0442.\u043a., \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u043f\u043e\u043b\u0435 \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u043c.  <\/p>\n<p>\u0412 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ca7\/1a6\/f39\/ca71a6f397867329837e561bfc06cfc3.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" width=\"1132\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ca7\/1a6\/f39\/ca71a6f397867329837e561bfc06cfc3.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p><strong>PartitionFilters<\/strong> \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c <strong>DataFilters<\/strong> \u0438 <strong>PushedFilters<\/strong>.<br \/><strong>DataFilters<\/strong> \u2013 \u044d\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043d\u0430 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445.<br \/><strong>PushedFilters<\/strong> \u2013 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff8\/710\/aac\/ff8710aac94b10ecc391e9e3a8bb3f04.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e\" width=\"1131\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff8\/710\/aac\/ff8710aac94b10ecc391e9e3a8bb3f04.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 <strong>DataFilters<\/strong> \u0444\u0438\u043b\u044c\u0442\u0440 \u0441 concat() \u0435\u0441\u0442\u044c, \u0430 \u0432 <strong>PushedFilters<\/strong> \u0443\u0436\u0435 \u043d\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u043f \u2013 <strong>Filter<\/strong>. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>PushedFilters<\/strong> \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043d\u0435 <em>\u043d\u0443\u0436\u043d\u044b\u0435<\/em> <em>\u0441\u0442\u0440\u043e\u043a\u0438,<\/em> \u0430 \u043c\u044b \u0431\u0435\u0440\u0435\u043c <em>\u0444\u0430\u0439\u043b\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438<\/em>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043b\u0438\u0448\u043d\u0435\u0435.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h2>3. \u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/50b\/488\/e33\/50b488e333e54d16ea5296cf53779384.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned\" width=\"1129\" height=\"363\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/50b\/488\/e33\/50b488e333e54d16ea5296cf53779384.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u0441\u043a\u0430\u0442\u044c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c <strong>Project<\/strong> \u2013 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c <strong>select<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h2>4. \u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 + \u0444\u0438\u043b\u044c\u0442\u0440<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fe4\/138\/ade\/fe4138adeb3a9b2545f894b11b0339a7.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id\" width=\"1132\" height=\"427\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe4\/138\/ade\/fe4138adeb3a9b2545f894b11b0339a7.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 <strong>PartitionFilters<\/strong> \u0438 <strong>PushedFilters<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u0432 \u043f. 2, \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <strong>ReadSchema<\/strong>. \u0415\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0442\u043e \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d\u043e \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0443\u0442\u0438 \u0435\u0441\u0442\u044c \u043f\u0430\u043f\u043a\u0430 \/loading_id=40678148. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 loading_id \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0432 \u0444\u0430\u0439\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h2>5. \u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/325\/12b\/c28\/32512bc28bdbdc19a236c576f8f5dca3.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" width=\"1129\" height=\"338\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/325\/12b\/c28\/32512bc28bdbdc19a236c576f8f5dca3.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c 2 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: <strong>InMemoryRelation, InMemoryTableScan<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p>\u0418\u0442\u0430\u043a, \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u0434\u043a\u0430\u043f\u043e\u0442\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0414\u0430\u043b\u0435\u0435 \u044f \u0431\u0443\u0434\u0443 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u0430 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0441\u0445\u0435\u043c\u044b \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"6\" id=\"6\"><\/a><\/p>\n<h2>6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/h2>\n<p>\u041e\u0431\u0435 \u043f\u0430\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Project<\/strong>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/af9\/05c\/c02\/af905cc02cc5417039e11fcf949c2e3f.png\" alt=\"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" title=\"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" width=\"838\" height=\"177\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af9\/05c\/c02\/af905cc02cc5417039e11fcf949c2e3f.png\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d22\/0ab\/1c6\/d220ab1c6740759ee8d62fc169237807.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443\" width=\"859\" height=\"182\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d22\/0ab\/1c6\/d220ab1c6740759ee8d62fc169237807.png\"\/><\/p>\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"7\" id=\"7\"><\/a><\/p>\n<h2>7. \u0421\u0435\u043b\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, case when<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bfa\/c61\/824\/bfac618242db7cd666cc7d24709012a4.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043f\u043e\u043b\u044f\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043f\u043e\u043b\u044f\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" width=\"1128\" height=\"122\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bfa\/c61\/824\/bfac618242db7cd666cc7d24709012a4.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043f\u043e\u043b\u044f\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/421\/57c\/c93\/42157cc939eac5efb24c6893799ce32b.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 case when\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 case when\" width=\"1127\" height=\"86\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/421\/57c\/c93\/42157cc939eac5efb24c6893799ce32b.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 case when<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, case when \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0430 \u043f\u043e\u043b\u0435\u0439, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Project<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"8\" id=\"8\"><\/a><\/p>\n<h2>8. \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/efb\/56a\/4a2\/efb56a4a27f91c03def740af6d50354b.png\" alt=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id\" title=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id\" width=\"1113\" height=\"180\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/efb\/56a\/4a2\/efb56a4a27f91c03def740af6d50354b.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1b2\/353\/ef2\/1b2353ef2f2d1c0438d99e03f31d0046.png\" alt=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 account_id \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id :)\" title=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 account_id \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id :)\" width=\"1130\" height=\"187\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1b2\/353\/ef2\/1b2353ef2f2d1c0438d99e03f31d0046.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 account_id \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id \ud83d\ude42<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435 account_id, \u0430 \u0441\u043f\u0430\u0440\u043a \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0447\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0432 <strong>FileScan<\/strong> \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <strong>Project<\/strong> \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0435\u0449\u0435 \u0442\u044f\u043d\u0435\u043c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<br \/><strong>HashAggregate<\/strong> \u2013 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f, keys \u2013 \u043f\u043e\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, functions \u2013 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f partial_count, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043f\u0430\u0440\u043a \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0432 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<p>1 \u2013 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438.<\/p>\n<p><strong>Exchange hashpartitioning<\/strong> \u2013 \u044d\u0442\u043e \u0448\u0430\u0444\u043b, 200 \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430. \u0412\u0441\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0445\u0435\u0448-\u043a\u043e\u0434\u0430, \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u043c\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0438 \u043a\u043b\u044e\u0447-partial_count.<\/p>\n<p>2 \u2013 \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 partial_count.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"9\" id=\"9\"><\/a><\/p>\n<h2>9. Distinct<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/543\/e5d\/077\/543e5d077aea3a80b90abc05a01dde51.png\" alt=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 account_id\" title=\"\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 account_id\" width=\"1130\" height=\"183\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/543\/e5d\/077\/543e5d077aea3a80b90abc05a01dde51.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 <strong>distinct<\/strong> \u043e\u0442 <strong>groupBy<\/strong> \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"10\" id=\"10\"><\/a><\/p>\n<h2>10. Sort<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b78\/86a\/9ed\/b7886a9eda8a1a7d7123475baedd927d.png\" alt=\"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u044e account_id\" title=\"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u044e account_id\" width=\"1128\" height=\"144\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b78\/86a\/9ed\/b7886a9eda8a1a7d7123475baedd927d.png\"\/><\/p>\n<div><figcaption>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u044e account_id<\/figcaption><\/div>\n<\/figure>\n<p><strong>Exchange rangepartitioning <\/strong>\u2013 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 account_id \u043e\u0442 1 \u0434\u043e 100 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 3 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438, \u0442\u043e account_id \u0441 1 \u043f\u043e 33 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044e, \u0441 34 \u043f\u043e 66 \u2013 \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h2>11. \u0410\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e7d\/bfa\/9c0\/e7dbfa9c0f75f00658531932056fcaac.png\" alt=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e start_time \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e account_id\" title=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e start_time \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e account_id\" width=\"1132\" height=\"179\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e7d\/bfa\/9c0\/e7dbfa9c0f75f00658531932056fcaac.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0447\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e start_time \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u2013<strong> SortAggregate<\/strong>. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 <strong>HashAggregate <\/strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0443 \u043d\u0430\u0441 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0442\u0438\u043f\u0430 string). \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. <strong>SortAggregate<\/strong> \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 <strong>HashAggregate<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u0434\u043e \u0448\u0430\u0444\u043b\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u043f\u043f\u0435\u0440\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430.<br \/>\u0418 \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 partial_min \u0438 min.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e2e\/6e7\/0f1\/e2e6e70f1edb407e8944d4620d31ef6e.png\" alt=\"\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e account_id \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435\" title=\"\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e account_id \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435\" width=\"1131\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e2e\/6e7\/0f1\/e2e6e70f1edb407e8944d4620d31ef6e.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e account_id \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432: \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f <strong>Exchange SinglePartition<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044e \u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0434\u0440\u0435. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, min, max, avg \u0438\u043b\u0438 \u0441 \u043e\u043a\u043e\u043d\u043a\u043e\u0439 \u0431\u0435\u0437 \u043a\u043b\u044e\u0447\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043f\u043b\u043e\u0445\u043e!).<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>12. DropDuplicates<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e04\/31b\/610\/e0431b610ba237390f51558f2aff288e.png\" alt=\"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u044e account_id\" title=\"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u044e account_id\" width=\"1133\" height=\"296\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e04\/31b\/610\/e0431b610ba237390f51558f2aff288e.png\"\/><\/p>\n<div><figcaption>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u044e account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>dropDuplicates<\/strong> \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f partial_first \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430 first \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430. \u0412\u0441\u0435 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"13\" id=\"13\"><\/a><\/p>\n<h2>13. Window functions<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/530\/d31\/3fe\/530d313feed12578d440934f5102ed07.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 rank\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 rank\" width=\"1131\" height=\"223\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/530\/d31\/3fe\/530d313feed12578d440934f5102ed07.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 rank<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0442\u0443\u0442 \u0443\u0436\u0435 \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0441 \u044d\u0442\u0430\u043f\u0430 \u0448\u0430\u0444\u043b\u0430. \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0441 .orderBy(), \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u0435\u0439. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043e\u043d\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f <strong>Window<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"14\" id=\"14\"><\/a><\/p>\n<h2>14. Union<\/h2>\n<p>\u041e\u0431\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Union<\/strong>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45a\/5b8\/4de\/45a5b84de7c44c7abd24299bdb6096ba.png\" alt=\"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432\" title=\"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432\" width=\"1135\" height=\"394\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45a\/5b8\/4de\/45a5b84de7c44c7abd24299bdb6096ba.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"15\" id=\"15\"><\/a><\/p>\n<h2>15. Join<\/h2>\n<p><strong>SortMergeJoin<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/422\/10d\/1e7\/42210d1e728ce8abbf818a3abdf89a74.png\" alt=\"SortMergeJoin\" title=\"SortMergeJoin\" width=\"1133\" height=\"376\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/422\/10d\/1e7\/42210d1e728ce8abbf818a3abdf89a74.png\"\/><\/p>\n<div><figcaption>SortMergeJoin<\/figcaption><\/div>\n<\/figure>\n<p>SMJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0438 \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b.<\/p>\n<p>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<br \/><strong>Filter isnotnull:<\/strong> \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 inner join, \u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null \u043d\u0435 \u043c\u043e\u0433\u0443\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0430\u0440\u043a \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430 \u043f\u043e \u0442\u0438\u043f\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u043e\u0432:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><strong>\u0422\u0438\u043f \u0434\u0436\u043e\u0439\u043d\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\"><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\"><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">inner<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043e\u0431\u0430 \u043a\u043b\u044e\u0447\u0430 \u043d\u0435 null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">left<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043b\u0435\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">right<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043f\u0440\u0430\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">full<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043e\u0431\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>Exchange hashpartitioning<\/strong> \u2013 \u043e\u0431\u0430 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0440\u0435\u043f\u0430\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 200 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>Sort<\/strong> \u2013 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>SortMergeJoin<\/strong> \u2013 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0430\u0440\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043b\u0435\u0432\u043e\u0433\u043e \u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438.<\/p>\n<p><strong>ShuffledHashJoin<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/242\/6aa\/1c7\/2426aa1c718c4147e9bd01daa16a3c83.png\" alt=\"ShuffledHashJoin\" title=\"ShuffledHashJoin\" width=\"1132\" height=\"325\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/242\/6aa\/1c7\/2426aa1c718c4147e9bd01daa16a3c83.png\"\/><\/p>\n<div><figcaption>ShuffledHashJoin<\/figcaption><\/div>\n<\/figure>\n<p>SHJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0445\u0438\u043d\u0442\u0430, \u0442.\u043a. \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f SMJ. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u0430\u043f <strong>Sort<\/strong> \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0434 \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>Exchange hashpartitioning  <\/strong>\u2013 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0434\u0436\u043e\u0439\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440.<br \/><strong>ShuffledHashJoin <\/strong>\u2013 \u043d\u0430 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447 \u2013 \u044d\u0442\u043e \u043a\u043e\u0440\u0442\u0435\u0436 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439 \u0434\u0436\u043e\u0439\u043d\u0430 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 id). \u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<p><strong>BroadcastHashJoin<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e13\/676\/9c3\/e136769c3409b14373e238e400a20b07.png\" alt=\"BroadcastHashJoin\" title=\"BroadcastHashJoin\" width=\"1127\" height=\"302\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e13\/676\/9c3\/e136769c3409b14373e238e400a20b07.png\"\/><\/p>\n<div><figcaption>BroadcastHashJoin<\/figcaption><\/div>\n<\/figure>\n<p>BHJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 <em>\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e<\/em> \u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u0430.<br \/><strong>BroadcastExchange<\/strong> \u2013 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440.<br \/>Hash join \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u2013 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438: \u0448\u0430\u0444\u043b \u0434\u043b\u044f SHJ \u0438 \u0431\u0440\u043e\u0430\u0434\u043a\u0430\u0441\u0442 \u0434\u043b\u044f BHJ.<\/p>\n<p><strong>BroadcastNestedLoopJoin<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/676\/1e6\/575\/6761e65752b7c6137ea7d2927ac95ece.png\" alt=\"BroadcastNestedLoopJoin\" title=\"BroadcastNestedLoopJoin\" width=\"1130\" height=\"308\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/676\/1e6\/575\/6761e65752b7c6137ea7d2927ac95ece.png\"\/><\/p>\n<div><figcaption>BroadcastNestedLoopJoin<\/figcaption><\/div>\n<\/figure>\n<p>BNLJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 <em>\u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e<\/em> \u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u0430.<br \/><strong>BroadcastNestedLoopJoin <\/strong>\u2013 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043b\u0435\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0438 \u043a\u043e\u043f\u0438\u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435.<\/p>\n<p><strong>CartesianProduct<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/64a\/d08\/e47\/64ad08e474bb2fff4313a75bee6633d7.png\" alt=\"CartesianProduct\" title=\"CartesianProduct\" width=\"1132\" height=\"269\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/64a\/d08\/e47\/64ad08e474bb2fff4313a75bee6633d7.png\"\/><\/p>\n<div><figcaption>CartesianProduct<\/figcaption><\/div>\n<\/figure>\n<p>CPJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 <em>\u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e<\/em>, \u043d\u043e BNLJ \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d.<br \/><strong>CartesianProduct<\/strong> \u2013 \u0441\u043f\u0430\u0440\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u044b \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043b\u0435\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0435\u0439 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u0430\u0440\u0443 \u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u0436\u043e\u0439\u043d\u0430.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"16\" id=\"16\"><\/a><\/p>\n<h2>16. Repartition<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8fa\/537\/553\/8fa537553dc08c16c92c5f392ce06887.png\" alt=\"\u0420\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\" title=\"\u0420\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\" width=\"806\" height=\"108\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8fa\/537\/553\/8fa537553dc08c16c92c5f392ce06887.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0438\u0434 \u0448\u0430\u0444\u043b\u0430 \u2013 <strong>Exchange RoundRobinPartitioning<\/strong>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430: \u043e\u043d \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043e\u0441\u044b (data skew).<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"17\" id=\"17\"><\/a><\/p>\n<h3>17. \u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/h3>\n<p>\u0421\u043e\u0432\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u0441\u0435!<br \/>(\u043d\u0443, \u043f\u043e\u0447\u0442\u0438)<br \/>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u043c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a6d\/863\/2a3\/a6d8632a3155955e706e1959ff89e754.png\" alt=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435\" title=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435\" width=\"1133\" height=\"434\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a6d\/863\/2a3\/a6d8632a3155955e706e1959ff89e754.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/499\/d7b\/bd7\/499d7bbd7d9ec1c2b3b043300a012837.png\" alt=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435\" title=\"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435\" width=\"1132\" height=\"432\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/499\/d7b\/bd7\/499d7bbd7d9ec1c2b3b043300a012837.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 where, groupBy, countDistinct, having \u0438 sort \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!<\/p>\n<p>\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b: <a href=\"https:\/\/t.me\/data_engineerette\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u0442\u0430 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0435\u0442\u0442\u0430<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/807421\/\"> https:\/\/habr.com\/ru\/articles\/807421\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0430\u0440\u0443 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043f\u043b\u0430\u043d\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0439: \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0434\u043e \u0434\u0436\u043e\u0439\u043d\u043e\u0432, \u043e\u043a\u043e\u043d\u043e\u043a \u0438 \u0440\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0438\u0434\u044b \u043f\u043b\u0430\u043d\u043e\u0432 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 3 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>campaigns \u2013 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u043f\u043e\u043b\u044e loading_id<\/p>\n<\/li>\n<li>\n<p>campaigns_not_partitioned \u2013 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u043e \u043d\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>stats \u2013 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0442\u044c \u0434\u0436\u043e\u0439\u043d\u044b<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 stats<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b stats<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043f\u0440\u043e \u0432\u0438\u0434\u044b \u043f\u043b\u0430\u043d\u043e\u0432<\/h2>\n<p>\u0412\u0441\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 4 \u043f\u043b\u0430\u043d\u0430:<\/p>\n<ol>\n<li>\n<p>Parsed Logical Plan \u2013 \u043f\u043b\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u043a\u043e\u0434\u043e\u043c, \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>Analyzed Logical Plan \u2013 \u043f\u043b\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>Optimized Logical Plan \u2013 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u043b\u0430\u043d\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>Physical Plan \u2013 \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u0438\u043a\u0438, \u043f\u0443\u0442\u0438, \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u043d, \u0442.\u043a. \u043e\u043d \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0427\u0442\u043e\u0431\u044b \u0447\u0442\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u044b\u043c, \u0435\u0441\u0442\u044c \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u0441\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<br \/>\u041f\u043e\u0433\u043d\u0430\u043b\u0438!<\/p>\n<p><a class=\"anchor\" name=\"start\" id=\"start\"><\/a><\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ol>\n<li>\n<p><a href=\"#1\" rel=\"noopener noreferrer nofollow\">\u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\" rel=\"noopener noreferrer nofollow\">\u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#4\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 + \u0444\u0438\u043b\u044c\u0442\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\" rel=\"noopener noreferrer nofollow\">\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#6\" rel=\"noopener noreferrer nofollow\">\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#7\" rel=\"noopener noreferrer nofollow\">\u0421\u0435\u043b\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#8\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#9\" rel=\"noopener noreferrer nofollow\">Distinct<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#10\" rel=\"noopener noreferrer nofollow\">Sort<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#11\" rel=\"noopener noreferrer nofollow\">\u0410\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#12\" rel=\"noopener noreferrer nofollow\">DropDuplicates<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#13\" rel=\"noopener noreferrer nofollow\">Window functions<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#14\" rel=\"noopener noreferrer nofollow\">Union<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#15\" rel=\"noopener noreferrer nofollow\">Join<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#16\" rel=\"noopener noreferrer nofollow\">Repartition<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#17\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h2>1. \u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0436, \u043f\u043e\u0439\u0434\u0435\u043c\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043f\u043b\u0430\u043d:<\/p>\n<p><strong>1) FileScan parquet<\/strong><br \/>\u041d\u0430\u0448\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0445\u0435\u043c\u044b, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u043f\u0430\u0440\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 hdfs \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043d\u0435\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435), \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043d\u0435\u0442, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><strong>2) ColumnarToRow<br \/><\/strong>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u043a\u0435\u0442-\u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u043e, \u043d\u043e \u0432 \u0441\u043f\u0430\u0440\u043a\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0431\u044b\u043b\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e \u043f\u043e\u043b\u044e loading_id. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c?<br \/>Location \u0432\u043c\u0435\u0441\u0442\u043e <strong>CatalogFileIndex<\/strong> \u0441\u0442\u0430\u043b <strong>InMemoryFileIndex<\/strong>.<br \/><strong>CatalogFileIndex<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<br \/><strong>InMemoryFileIndex<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>2. \u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0435 <strong>PartitionFilters<\/strong> \u2013 \u043c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u0412\u043e\u043e\u0431\u0449\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 Catalyst \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u2013 <strong>isnotnull<\/strong>, \u0442.\u043a., \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u043f\u043e\u043b\u0435 \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u043c.  <\/p>\n<p>\u0412 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p><strong>PartitionFilters<\/strong> \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c <strong>DataFilters<\/strong> \u0438 <strong>PushedFilters<\/strong>.<br \/><strong>DataFilters<\/strong> \u2013 \u044d\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043d\u0430 \u043d\u0435\u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445.<br \/><strong>PushedFilters<\/strong> \u2013 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 <strong>DataFilters<\/strong> \u0444\u0438\u043b\u044c\u0442\u0440 \u0441 concat() \u0435\u0441\u0442\u044c, \u0430 \u0432 <strong>PushedFilters<\/strong> \u0443\u0436\u0435 \u043d\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u043f \u2013 <strong>Filter<\/strong>. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>PushedFilters<\/strong> \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043d\u0435 <em>\u043d\u0443\u0436\u043d\u044b\u0435<\/em> <em>\u0441\u0442\u0440\u043e\u043a\u0438,<\/em> \u0430 \u043c\u044b \u0431\u0435\u0440\u0435\u043c <em>\u0444\u0430\u0439\u043b\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438<\/em>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043b\u0438\u0448\u043d\u0435\u0435.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h2>3. \u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u0441\u043a\u0430\u0442\u044c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c <strong>Project<\/strong> \u2013 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c <strong>select<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h2>4. \u0421\u0435\u043b\u0435\u043a\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 + \u0444\u0438\u043b\u044c\u0442\u0440<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u044f account_id \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 campaigns \/ campaigns_not_partitioned \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u043f\u043e loading_id<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 <strong>PartitionFilters<\/strong> \u0438 <strong>PushedFilters<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u0432 \u043f. 2, \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <strong>ReadSchema<\/strong>. \u0415\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0442\u043e \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d\u043e \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0443\u0442\u0438 \u0435\u0441\u0442\u044c \u043f\u0430\u043f\u043a\u0430 \/loading_id=40678148. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 loading_id \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0432 \u0444\u0430\u0439\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h2>5. \u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0438\u0437 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c 2 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: <strong>InMemoryRelation, InMemoryTableScan<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p>\u0418\u0442\u0430\u043a, \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u0434\u043a\u0430\u043f\u043e\u0442\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0414\u0430\u043b\u0435\u0435 \u044f \u0431\u0443\u0434\u0443 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u0430 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0441\u0445\u0435\u043c\u044b \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"6\" id=\"6\"><\/a><\/p>\n<h2>6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430<\/h2>\n<p>\u041e\u0431\u0435 \u043f\u0430\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Project<\/strong>:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"7\" id=\"7\"><\/a><\/p>\n<h2>7. \u0421\u0435\u043b\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, case when<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043f\u043e\u043b\u044f\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 case when<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, case when \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0430 \u043f\u043e\u043b\u0435\u0439, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Project<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"8\" id=\"8\"><\/a><\/p>\n<h2>8. \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 account_id \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 account_id \ud83d\ude42<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435 account_id, \u0430 \u0441\u043f\u0430\u0440\u043a \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0447\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0432 <strong>FileScan<\/strong> \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <strong>Project<\/strong> \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0435\u0449\u0435 \u0442\u044f\u043d\u0435\u043c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043b\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<br \/><strong>HashAggregate<\/strong> \u2013 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f, keys \u2013 \u043f\u043e\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, functions \u2013 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f partial_count, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043f\u0430\u0440\u043a \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0432 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<p>1 \u2013 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438.<\/p>\n<p><strong>Exchange hashpartitioning<\/strong> \u2013 \u044d\u0442\u043e \u0448\u0430\u0444\u043b, 200 \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430. \u0412\u0441\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0445\u0435\u0448-\u043a\u043e\u0434\u0430, \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u043c\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0438 \u043a\u043b\u044e\u0447-partial_count.<\/p>\n<p>2 \u2013 \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 partial_count.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"9\" id=\"9\"><\/a><\/p>\n<h2>9. Distinct<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 <strong>distinct<\/strong> \u043e\u0442 <strong>groupBy<\/strong> \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"10\" id=\"10\"><\/a><\/p>\n<h2>10. Sort<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u044e account_id<\/figcaption><\/div>\n<\/figure>\n<p><strong>Exchange rangepartitioning <\/strong>\u2013 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 account_id \u043e\u0442 1 \u0434\u043e 100 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 3 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438, \u0442\u043e account_id \u0441 1 \u043f\u043e 33 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044e, \u0441 34 \u043f\u043e 66 \u2013 \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h2>11. \u0410\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0441\u0447\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e start_time \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u2013<strong> SortAggregate<\/strong>. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 <strong>HashAggregate <\/strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0443 \u043d\u0430\u0441 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0442\u0438\u043f\u0430 string). \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. <strong>SortAggregate<\/strong> \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 <strong>HashAggregate<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u0434\u043e \u0448\u0430\u0444\u043b\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u043f\u043f\u0435\u0440\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430.<br \/>\u0418 \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 partial_min \u0438 min.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e account_id \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432: \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f <strong>Exchange SinglePartition<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044e \u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0434\u0440\u0435. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, min, max, avg \u0438\u043b\u0438 \u0441 \u043e\u043a\u043e\u043d\u043a\u043e\u0439 \u0431\u0435\u0437 \u043a\u043b\u044e\u0447\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043f\u043b\u043e\u0445\u043e!).<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>12. DropDuplicates<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u044e account_id<\/figcaption><\/div>\n<\/figure>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>dropDuplicates<\/strong> \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f partial_first \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0444\u043b\u0430 first \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430. \u0412\u0441\u0435 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"13\" id=\"13\"><\/a><\/p>\n<h2>13. Window functions<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 rank<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0442\u0443\u0442 \u0443\u0436\u0435 \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0441 \u044d\u0442\u0430\u043f\u0430 \u0448\u0430\u0444\u043b\u0430. \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0441 .orderBy(), \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u0435\u0439. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043e\u043d\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f <strong>Window<\/strong>.<\/p>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"14\" id=\"14\"><\/a><\/p>\n<h2>14. Union<\/h2>\n<p>\u041e\u0431\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <strong>Union<\/strong>:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"#start\" rel=\"noopener noreferrer nofollow\">\u041a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e\u2b06\ufe0f<\/a><\/p>\n<p><a class=\"anchor\" name=\"15\" id=\"15\"><\/a><\/p>\n<h2>15. Join<\/h2>\n<p><strong>SortMergeJoin<\/strong><\/p>\n<figure class=\"full-width\">\n<div><figcaption>SortMergeJoin<\/figcaption><\/div>\n<\/figure>\n<p>SMJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0438 \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b.<\/p>\n<p>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<br \/><strong>Filter isnotnull:<\/strong> \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 inner join, \u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null \u043d\u0435 \u043c\u043e\u0433\u0443\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0430\u0440\u043a \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430 \u043f\u043e \u0442\u0438\u043f\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u043e\u0432:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><strong>\u0422\u0438\u043f \u0434\u0436\u043e\u0439\u043d\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\"><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043b\u0435\u0432\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\"><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">inner<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043e\u0431\u0430 \u043a\u043b\u044e\u0447\u0430 \u043d\u0435 null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">left<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043b\u0435\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">right<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">+<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043f\u0440\u0430\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">full<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u043e\u0431\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c null<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>Exchange hashpartitioning<\/strong> \u2013 \u043e\u0431\u0430 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0440\u0435\u043f\u0430\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 200 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>Sort<\/strong> \u2013 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>SortMergeJoin<\/strong> \u2013 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0430\u0440\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043b\u0435\u0432\u043e\u0433\u043e \u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438.<\/p>\n<p><strong>ShuffledHashJoin<\/strong><\/p>\n<figure class=\"full-width\">\n<div><figcaption>ShuffledHashJoin<\/figcaption><\/div>\n<\/figure>\n<p>SHJ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0445\u0438\u043d\u0442\u0430, \u0442.\u043a. \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f SMJ. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u0430\u043f <strong>Sort<\/strong> \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0434 \u0434\u0436\u043e\u0439\u043d\u0430.<br \/><strong>Exchange hashpartitioning  <\/strong>\u2013 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0434\u0436\u043e\u0439\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440.<br \/><strong>ShuffledHashJoin <\/strong>\u2013 \u043d\u0430 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u0435<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-373520","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=373520"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373520\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}