{"id":296372,"date":"2019-12-25T15:00:18","date_gmt":"2019-12-25T15:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296372"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296372","title":{"rendered":"Apache Spark, lazy evaluation \u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/alfastrah\/blog\/481924\/\">\n<p>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u043e\u0431 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c: spark \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u201c\u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430\u043c\u0438\u201d (dataframes), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b &#171;\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0441\u0442\u0430&#187; \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u2014 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0442\u043e\u043c\u044b (\u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438) \u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f ETL \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"lazy-evaluation\">Lazy evaluation<\/h1>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c spark \u2014 lazy evaluation: \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439 (transformations) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (actions). \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (\u0433\u0440\u0443\u0431\u043e): \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e, \u201c\u0441\u043a\u043b\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f\u201d, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0442\u0440\u043e\u0438\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441 \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0434\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u201c\u0430\u0442\u043e\u043c\u044b\u201d \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u0427\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p>  <\/p>\n<h1 id=\"mnogostranichnyy-sql\">\u041c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 SQL<\/h1>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u201c\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435\u201d SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0435\u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b (\u043d\u0435\u0436\u0435\u043b\u0430\u043d\u0438\u0435, \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438). \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0445\u0432\u0430\u0442\u0438\u0442).<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">qSel = \"\"\" select     con.contract_id as con_contract_id,     con.begin_date as con_begin_date,     con.product_id as con_product_id,     cst.contract_status_type_id as cst_status_type_id,     sbj.subject_id as sbj_subject_id,     sbj.subject_name as sbj_subject_name,     pp.birth_date as pp_birth_date from     kasko.contract con     join kasko.contract_status cst on cst.contract_status_id = con.contract_status_id     join kasko.subject sbj on sbj.subject_id = con.owner_subject_id     left join kasko.physical_person pp on pp.subject_id = con.owner_subject_id \"\"\" dfSel = sp.sql(qSel)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 <\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b join-\u043e\u0432 <\/li>\n<li>\u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e select \u0447\u0430\u0441\u0442\u0438, join \u0447\u0430\u0441\u0442\u0438 (\u0438 where \u0447\u0430\u0441\u0442\u0438, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0435 \u043d\u0435\u0442 \u2014 \u044f \u0435\u0435 \u0443\u0431\u0440\u0430\u043b \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b contract \u0438 contract_status, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0435\u0435 \u0441 subject, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0442.\u043f.). \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u044b \u0442\u0430\u043a \u0438 \u0434\u0435\u043b\u0430\u0435\u043c, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u2014 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u2014 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0443\u044e \u0433\u043b\u044b\u0431\u0443.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043b\u043e\u0445\u043e\u0433\u043e? \u0414\u0430 \u043d\u0438\u0447\u0435\u0433\u043e, \u0432-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0432\u0441\u0435 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u2014 \u0430 \u0442\u043e\u0447\u043d\u0435\u0435, \u0447\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u2014 \u0435\u0441\u0442\u044c, \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<h1 id=\"tot-zhe-zapros-v-spark\">\u0422\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 spark<\/h1>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 spark \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 (\u0438 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c), \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u043e\u0442 \u201c\u0441\u043b\u043e\u0436\u043d\u044b\u0439\u201d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u201c\u0430\u0442\u043e\u043c\u044b\u201d \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b. \u0418\u0445 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 4).<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043e\u043d\u0438 \u2014 \u201c\u0430\u0442\u043e\u043c\u044b\u201d:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">dfCon = sp.sql(\"\"\"select     contract_id as con_contract_id,     begin_date as con_begin_date,     product_id as con_product_id,     owner_subject_id as con_owner_subject_id,     contract_status_id as con_contract_status_id from     kasko.contract\"\"\")  dfCStat = sp.sql(\"\"\"select      contract_status_id as cst_status_id,     contract_status_type_id as cst_status_type_id from     kasko.contract_status\"\"\")  dfSubj = sp.sql(\"\"\"select     subject_id as sbj_subject_id,     subject_type_id as sbj_subject_type_id,     subject_name as sbj_subject_name from     kasko.subject\"\"\")  dfPPers = sp.sql(\"\"\"select     subject_id as pp_subject_id,     birth_date as pp_birth_date from     kasko.physical_person\"\"\")<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0438\u0445 (join) spark \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u201c\u0430\u0442\u043e\u043c\u043e\u0432\u201d, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">con_stat = f.col(\"cst_status_id\")==f.col(\"con_contract_status_id\") con_subj_own = f.col(\"con_owner_subject_id\")==f.col(\"sbj_subject_id\") con_ppers_own = f.col(\"con_owner_subject_id\")==f.col(\"pp_subject_id\")<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043d\u0430\u0448 \u201c\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u201d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">dfAtom = dfCon.join(dfCStat,con_stat, \"inner\")\\     .join(dfSubj,con_subj_own,\"inner\") \\     .join(dfPPers,con_ppers_own, \"left\") \\               .drop(\"con_contract_status_id\",\"sbj_subject_type_id\",           \"pp_subject_id\",\"con_owner_subject_id\",\"cst_status_id\")<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e? \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u2014 \u043d\u0438\u0447\u0435\u0433\u043e, \u0434\u0430\u0436\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u043f\u043e \u201c\u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443\u201d SQL \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u201c\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u043c\u0443\u201d \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u2014 \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u201c\u0430\u0442\u043e\u043c\u044b\u201d \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u2014 \u0432 jupyter \u043a\u043d\u0438\u0436\u043a\u0435 \u043f\u043e <a href=\"https:\/\/github.com\/korolmi\/dataeng\/tree\/master\/data_doc\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043f\u043b\u0430\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u043e\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0439\u0442\u0438 10 \u043e\u0442\u043b\u0438\u0447\u0438\u0439, \u043d\u043e \u0441\u0443\u0442\u044c \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u2014 \u043d\u0430\u043b\u0438\u0446\u043e). \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0438\u043a\u0430\u043a\u043e\u0435 \u043d\u0435 \u0447\u0443\u0434\u043e, \u0442\u0430\u043a \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c (\u0441\u043c. \u0432\u044b\u0448\u0435 \u043f\u0440\u043e lazy evaluation \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u043c\u0435\u0435\u043c \u0432 \u0438\u0442\u043e\u0433\u0435 \u2014 \u201c\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439\u201d \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u201c\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0439\u201d \u0437\u0430\u043f\u0440\u043e\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e (\u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u0442\u0435\u0440\u044f\u044e\u0442 \u0441\u043c\u044b\u0441\u043b).<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0439\u0434\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432 \u201c\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u043c\u201d \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u201c\u0430\u0442\u043e\u043c\u201d (\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c) \u2014 \u044d\u0442\u043e \u043d\u0430\u0448\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b). \u0412\u044b\u0434\u0435\u043b\u044f\u044f \u0442\u0430\u043a\u0438\u0435 \u201c\u0430\u0442\u043e\u043c\u044b\u201d \u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 (\u0438, \u0447\u0442\u043e \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u043e, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e) \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u043d\u0430\u0441 \u0447\u0430\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u043e\u0437\u0440\u0438\u043c\u043e\u0439 \u0448\u0442\u0443\u043a\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u201c\u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445\u201d.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0438 join? \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a (\u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438) \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044e \u2014 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u2014 \u044d\u0442\u0438 \u201c\u0437\u043d\u0430\u043d\u0438\u044f\u201d (\u0430\u0442\u043e\u043c\u044b \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f) \u0443 \u043d\u0430\u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u043a\u043e\u0434\u0435 (\u043d\u0435 \u0432 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u0438\u043b\u0438 \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438), \u044d\u0442\u043e \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 ETL \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u0442, \u043a\u0441\u0442\u0430\u0442\u0438, \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438).<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u2014 \u043a\u0430\u043a \u043c\u044b \u0441 \u0412\u0430\u043c\u0438 \u0437\u043d\u0430\u0435\u043c \u0438\u0437 clean coder \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432, \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e\u0449\u0438\u0445 \u043d\u0430 \u201c\u0437\u0432\u0430\u043d\u0438\u0435\u201d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f. \u0422\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u201c\u0430\u0442\u043e\u043c\u043e\u0432\u201d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0430\u0433 \u0432\u043f\u0435\u0440\u0435\u0434 \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0430\u0436\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u043a\u0430\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0435\u0449\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u201c\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u0438\u201d?<\/p>\n<p>  <\/p>\n<h1 id=\"optimizaciya-konveyerov\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044f, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0441\u044f \u2014 ETL \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443. \u0412 \u043d\u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u044f \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0432 \u044d\u043a\u0441\u0435\u043b\u044c\u043a\u0435 \u2014 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 40% \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438? \u0411\u0430\u0440\u0434\u0430\u043a \u2014 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u2026<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c? \u0412 spark \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u2014 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043a\u044d\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043a\u044d\u0448\u0430 (\u0438\u0431\u043e \u0432\u0441\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043d\u0435\u0433\u043e \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u201c\u043d\u0435 \u0432\u043b\u0435\u0437\u0443\u0442\u201d, \u043d\u0430 \u0442\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u201c\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445\u201d SSQ \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432? \u0414\u0430, \u043d\u043e\u2026 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e (\u0443 \u043d\u0430\u0441 \u0442\u0430\u043c \u0438 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432-\u0442\u043e \u0442\u043e\u043b\u043a\u043e\u043c \u043d\u0435\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438\u0445 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e spark \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442).<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u201c\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0445\u201d \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432? \u0414\u0430! \u0418 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u201c\u0430\u0442\u043e\u043c\u044b\u201d \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0438\u0445 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u044d\u0442\u043e \u201c\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u201d \u0438 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0435 (\u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0432 where \u0447\u0430\u0441\u0442\u0438), \u043e\u043d\u0430 \u2014 \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0430\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0430\u0442\u043e\u043c\u044b (\u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b), \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0431\u044b\u043b\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e (\u0441\u0438\u0435 \u043d\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0437\u0443\u0435\u043c\u043e, \u043a\u0441\u0442\u0430\u0442\u0438).<\/p>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u201c\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u201d. \u0410 \u0432 \u043f\u0440\u0438\u0434\u0430\u0447\u0443 \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438 \u0432\u0430\u0436\u043d\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u2014 \u201c\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443\u201d \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<h1 id=\"robotizaciya-i-avtomatizaciya\">\u0420\u043e\u0431\u043e\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u0410\u0442\u043e\u043c\u044b \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043d\u0435\u0436\u0435\u043b\u0438 \u201c\u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u0438 \u043c\u043e\u0433\u0443\u0447\u0438\u0439 SQL\u201d \u2014 \u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0437\u0430 \u043d\u0430\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f spark (\u0437\u0430 \u0447\u0442\u043e \u0435\u043c\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e), \u043e\u043d \u0436\u0435 \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0438 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u201c\u043d\u0430\u0438\u0433\u0440\u0430\u0442\u044c\u201d.<\/p>\n<p>  <\/p>\n<h1 id=\"v-zaklyuchenie\">\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u0435\u043d \u2014 \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c (\u0430\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c, \u043d\u0435\u0436\u0435\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0441\u0442\u0444\u0430\u043a\u0442\u0443\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0435\u0440\u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0434\u043e\u0431\u0430\u0432\u043e\u043a \u2014 \u043a\u0441\u0442\u0430\u0442\u0438, \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443 \u0435\u0449\u0435 \u201c\u0434\u043e\u0431\u0430\u0432\u043e\u043a\u201d \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0432 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u201c\u0440\u0430\u0431\u043e\u0447\u0438\u043c\u201d? \u041e\u043d \u2014 \u0447\u0430\u0441\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0430, \u0437\u043d\u0430\u0447\u0438\u0442, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u043d\u0441 \u0431\u044b\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0432 \u0434\u043e\u043b\u0433\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435.<\/p>\n<p>  <\/p>\n<p>\u042f, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b \u2014 \u043f\u043e\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 (\u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)?<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <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\/company\/alfastrah\/blog\/481924\/\"> https:\/\/habr.com\/ru\/company\/alfastrah\/blog\/481924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/alfastrah\/blog\/481924\/\">\n<p>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u043e\u0431 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c: spark \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u201c\u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430\u043c\u0438\u201d (dataframes), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b &#171;\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0441\u0442\u0430&#187; \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u2014 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0442\u043e\u043c\u044b (\u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438) \u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f ETL \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430.<\/p>\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-296372","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296372","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=296372"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296372\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}