{"id":304372,"date":"2020-05-27T21:00:29","date_gmt":"2020-05-27T21:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304372"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304372","title":{"rendered":"\u0421\u043a\u0430\u0437 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b BigQuery \u043f\u0440\u0438\u0440\u0443\u0447\u0430\u043b\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504180\/\">\n<h3 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0437\u0430\u0434\u0430\u0447\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u0430 \u0434\u043e \u0443\u043d\u044b\u043d\u0438\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c \u043e\u0442\u0434\u0435\u043b\u0430 e-commerce \u043c\u0430\u043b\u043e\u0439 \u043a\u0440\u043e\u0432\u044c\u044e, \u0442.\u0435., \u0447\u0438\u0442\u0430\u0439, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0440\u043e\u043c.<a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f? \u041a\u043e\u0440\u0437\u0438\u043d\u044b \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u044f\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431 \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u043c\u0438\u0440\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0438\u043c\u0438: \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u043b\u044e\u0442\u044b, \u0447\u0430\u0441\u043e\u0432\u044b\u0435 \u043f\u043e\u044f\u0441\u0430, \u043d\u0430\u043b\u043e\u0433\u0438, \u0442\u0438\u043f\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0432\u0438\u0434\u044b \u043d\u043e\u043c\u0435\u043d\u043a\u043b\u0430\u0442\u0443\u0440\u044b, \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0438 \u0442.\u0434. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043b\u044e\u0431\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d, \u0442\u043e\u043b\u044c\u043a\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0441\u0438\u0434\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0430\u0448\u0431\u043e\u0440\u0434, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0438\u0437\u043d\u0435\u0441 \u043c\u043e\u0433 \u0431\u044b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d\u043b\u0430\u0439\u043d (\u0430 \u0442\u043e\u0447\u043d\u0435\u0435, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e) \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043a\u0430\u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0442\u0430\u043a \u0438 \u043f\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0430\u043c. \u0414\u0430 \u0435\u0449\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0438\u0445 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u043e\u0432 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"poisk-resheniya\">\u041f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u0441 \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0421\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0442\u0430\u043a\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Owox, \u0440\u0435\u0448\u0435\u043d\u0438\u044f BI \u043e\u0442 Microsoft, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e enterprise \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.<br \/>  \u0412\u0441\u0435 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u043e\u0439. \u041d\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043d\u0435\u0434\u0435\u0448\u0435\u0432\u043e<\/li>\n<li>\u0432\u0435\u0449\u044c \u0432 \u0441\u0435\u0431\u0435 (\u043d\u0435 \u0442\u0430\u043a-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043f\u043e\u0434\u0447\u0430\u0441 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0438 \u0434\u0430\u0442\u0430-\u0441\u0430\u0439\u043d\u0442\u0438\u0441\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (2019 \u0433\u043e\u0434) \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0430\u0440\u043c\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u043a \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Datastudio, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0433\u043e\u0434 \u0438 \u0441\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043e\u043d \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u043b \u043e\u0442\u0447\u0435\u0442 \u0438\u0437 1\u0421, \u0437\u0430\u043b\u0438\u0432\u0430\u043b \u0435\u0433\u043e \u0432 Google Storage Cloud (\u043d\u0435 \u043f\u0443\u0442\u0430\u0435\u043c \u0441 GoogleDrive), \u043e\u0442\u0442\u0443\u0434\u0430 \u2014 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 BigQuery, \u043d\u0443 \u0438 \u0434\u0430\u043b\u0435\u0435 \u0443\u0436\u0435 \u0432 DataStudio \u0434\u0435\u043b\u0430\u043b \u0441\u0440\u0435\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0443\u043c\u0430\u043b\u043e\u0441\u044c \u2014 \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435, \u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430, \u043f\u0440\u0438\u0447\u0435\u043c, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043b \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f, \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0437\u0430 \u0442\u043e\u0442 \u0433\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0443\u0441\u0435\u0440\u0434\u043d\u043e \u0434\u0435\u043b\u0430\u043b \u0440\u0443\u043a\u0430\u043c\u0438 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u0432\u0441\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0413\u0443\u0433\u043b\u043e\u043c \u0443\u0448\u043b\u0430 \u0434\u0430\u043b\u0435\u043a\u043e \u0432\u043f\u0435\u0440\u0435\u0434. \u0418 Data Studio \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u043e, \u0438 BigQuery \u043e\u0431\u0440\u043e\u0441 \u0433\u0438\u0433\u0430\u043d\u0442\u0441\u043a\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c, \u0438, \u0447\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0440\u0435\u0448\u0430\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u043b\u0438, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 SQL \u0432 BigQuery, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0438\u0437\u0434\u0435\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0434 \u043d\u0438\u043c\u0438, \u043a\u0430\u043a \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 BigQuery (<a href=\"http:\/\/console.cloud.google.com\/bigquery\">https:\/\/console.cloud.google.com\/bigquery<\/a>), \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u043e\u043d\u0443\u0441\u043d\u044b\u0435 \u043d\u0430 \u0441\u0447\u0435\u0442, \u0438 \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<\/p>\n<p>  <\/p>\n<p><strong>\u041a\u0441\u0442\u0430\u0442\u0438, \u0446\u0435\u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/strong>: \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0437\u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043d\u0443\u0441\u043d\u044b\u0435 300 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432. \u041f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b BigQuery, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0436\u0434\u044b\u0435 \u0441\u0443\u0442\u043a\u0438 \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c \u0438 \u0437\u0430\u043a\u0430\u0437\u0430\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"priruchenie\">\u041f\u0440\u0438\u0440\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0442\u0430\u043a. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u0434\u0430 \u043b\u0438\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 BigQuery \u0438\u043c\u0435\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0415\u0432\u0440\u043e\u043f\u0435 \u0438 \u0421\u0428\u0410, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0424\u043e\u043a\u0443\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f!<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043b\u043e \u0431\u044b\u0442\u044c, \u0434\u0435\u043b\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c SELECT, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 BQ.<\/p>\n<p>  <\/p>\n<p>\u0410 \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 BQ \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0411\u0414, \u043d\u043e \u0441 \u0440\u044f\u0434\u043e\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0430\u043a \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0439 \u0411\u0414 \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043b\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e, \u0430 \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043b\u0435\u0442\u0443, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0433\u043e\u0434\u0438\u043b\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><em>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u0446\u0435\u043f\u043e\u0447\u043a\u0443<\/em>: SQL ==&gt; \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 Python ==&gt; BigQuery.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0442\u0443\u0442 \u2014 \u0441\u0435\u0440\u0432\u0430\u043a \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430, \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u0431\u044b\u043b \u0435\u0449\u0435 \u043a\u0440\u0438\u0432\u043e\u0439 \u043f\u043b\u0430\u043d \u0441 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 SELECT \u0432 csv-\u0444\u0430\u0439\u043b\u044b \u043d\u0430 GoogleStorage \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0438\u0445 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0432 BQ \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Google Functions, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Python (\u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445) \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u0445 \u043f\u043e\u0434 \u043a\u0440\u043e\u043d\u043e\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 6 \u043c\u0438\u043d\u0443\u0442 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438) \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0437\u0430\u0447\u0435\u043c \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u043f\u0440\u044f\u043c\u044b\u043c \u043f\u0443\u0442\u0435\u043c?<\/p>\n<p>  <\/p>\n<h4 id=\"import\">\u0418\u043c\u043f\u043e\u0440\u0442<\/h4>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0437\u0435\u0440\u043a\u0430\u043b\u0443 \u0431\u043e\u0435\u0432\u043e\u0439 SQL \u0438 \u0441\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0430\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u0440\u0435\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Orders, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0442\u0430\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u0430\u043a \u0434\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430, \u0434\u0430\u0442\u0430 \u043e\u043f\u043b\u0430\u0442\u044b, \u0441\u0443\u043c\u043c\u0430 \u0432 \u0432\u0430\u043b\u044e\u0442\u0435, \u043d\u0430\u043b\u043e\u0433 \u0432 \u0432\u0430\u043b\u044e\u0442\u0435, \u043a\u0443\u0440\u0441 \u0432\u0430\u043b\u044e\u0442\u044b \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0430\u043b\u044e\u0442\u044b, \u043a\u043b\u0438\u0435\u043d\u0442 id, id \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0438 \u0442.\u0434. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0411\u0414 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 SELECT \u043f\u0438\u0448\u0435\u0442 \u0432 pandas dataframe. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import pandas as pd import MySQLdb import MySQLdb.cursors  def sql_query(date0, date1):     connection = MySQLdb.connect(host=\u201dserver\u201d, user=\u201duser\u201d, passwd=\u201dpass\u201d, db=\u201dorders\u201d, charset=\u201dcp1251\u201d, cursorclass = MySQLdb.cursors.SSCursor)     query = \u201cSELECT * FROM orders WHERE date&gt;=\u2019\u201d+date0+\u201d\u2019 and date&lt;\u2019\u201d+date1+\u201d\u2019 \u201d     data =  pd.read_sql_query(query, connection=connection) # \u0417\u0434\u0435\u0441\u044c query - \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 SELECT \u043a \u0432\u0430\u0448\u0435\u0439 \u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b date0 \u0438 date1, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u0435\u0447\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043a\u0430\u0436\u0435\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 5 \u0434\u043d\u0435\u0439. \u041c\u044b \u0436\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0433\u043e\u043d\u044f\u0442\u044c \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 - \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043f\u043e \u0434\u0435\u043d\u044c\u0433\u0430\u043c. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0448\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u0449\u0438\u0442\u044c \u0432 BQ # \u041d\u0443, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 connection \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u043a\u0443\u0440\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0438 \u0442.\u043f. \u0412 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u0435\u043c.  # \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0434\u0430\u0442\u044b \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u043e\u0441\u0431\u043e\u043c:      data.payment_date = data.payment_date.apply(lambda x: x.tz_localize(\u2018Europe\/Moscow\u2019)).astype(str)  # \u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0442\u0438\u043f str - \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0430\u0442\u0443 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u043e\u044f\u0441\u0430\u0445. \u0410 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 BQ \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.  # \u0412\u043e\u043e\u0431\u0449\u0435, \u043b\u0443\u0447\u0448\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 pandas \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u043e\u043c \u0432 BQ, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0435 \u0442\u0438\u043f\u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043b\u0438\u0432\u043a\u0438, \u043b\u0438\u0431\u043e \u0436\u0435 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.      return data <\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0430\u043a\u0435 \u043c\u0430\u043b\u043e\u0432\u0430\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u0436\u0435 5-\u0434\u043d\u0435\u0432\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0437\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0434\u0430\u0442 (90 \u0434\u043d\u0435\u0439, \u0442.\u043a. \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u043a\u0430\u0437\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0440\u0442\u0430\u043b\u0430) \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0438\u043a\u043b\u043e\u043c, \u0438 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c sql_query(date) \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c \u0434\u0430\u0442, \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 BQ.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043e\u0442\u0434\u0430\u0435\u043c pandas dataframe \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<h4 id=\"eksport\">\u042d\u043a\u0441\u043f\u043e\u0440\u0442<\/h4>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f: \u0437\u0430\u043b\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0431\u043b\u043e\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0438\u043b\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0433\u043e BQ \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 MERGE \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439. \u0412 BQ \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u043c\u0438 \u0441\u0442\u0440\u043e\u043a \u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u0430 1-2 \u043c\u0438\u043d\u0443\u0442\u044b. \u0423 \u043d\u0430\u0441 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 20 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u043e\u043a\u043e\u043b\u043e 70 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0438\u043f\u0430 STRING \u0438 FLOAT. \u0410 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 70000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0438 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430 \u043f\u043e \u0434\u043d\u044f\u043c. \u0410 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0434\u043b\u044f BQ, \u0438 \u0434\u043b\u044f \u043d\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0434\u0435\u0448\u0435\u0432\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from google.cloud import bigquery from google.oauth2 import service_account  project_id = \u201cMyBQproject\u201d  # \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 BQ dataset_id = \u201cMyDataSet\u201d  # \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435  # \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0446\u0435\u043f\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0432 BQ. \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u0430-\u043a\u043b\u044e\u0447\u0430 (\u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e \u0432 \u0441\u0435\u043a\u0443\u0440\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435). \u0421\u0430\u043c \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 BQ. \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438, \u0433\u0434\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f, \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u2018Service accounts\u2019 \u0432 Google Cloud Platform.  credentials = service_account.Credentials.from_service_account_file(\u201cacc.json\u201d) client = bigquery.Client(project_id, credentials=credentials)  def upload_temp_table(df, table_id, schema):     job_config = bigquery.LoadJobConfig()     job_config.schema = schema    # job_config.autodetect = True  # \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443     job_config.write_disposition = bigquery.WriteDisposition.WRITE_TRUNCATE  # \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443     job = client.load_table_from_dataframe(df, table_id, job_config=job_config)     job.result()   # \u043f\u043e\u0434\u043e\u0436\u0434\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430  def merge_tables(temp_table, base_table, schema, head, merge_param):     merge_query = \u201cMERGE into \u201c+base_table+\u201d as T USING \u201c+temp_table+\u201d as S \\          ON T.\u201d+merge_param+\u201d = S.\u201d+merge_param+ \\          \u201c WHEN MATCHED then UPDATE SET \u201c+ \\          \u2018,\u2019.join([\u2018T.\u2019+item+\u2019=S.\u2019+item for item in head])+ \\          \u201c WHEN NOT MATCHED then INSERT \\          (\u201c+\u2019,\u2019.join(head)+\u201d) VALUES (\u201c+\u2019,\u2019.join([\u2018S.\u2019+item for item in head])+\u201d);\u201d  # \u0422\u043e \u0435\u0441\u0442\u044c, \u043c\u0435\u0440\u0436\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 merge_param (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e id \u0437\u0430\u043a\u0430\u0437\u0430, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0437\u0430\u043a\u0430\u0437\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b)  # \u0421\u0445\u0435\u043c\u0443 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c      job_config = bigquery.LoadJobConfig()     job_config.schema = schema     job = client.query(merge_query, job_config=job_config)     job.result() <\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u2014 \u044d\u0442\u043e \u0446\u0438\u043a\u043b \u043f\u043e \u0434\u0430\u0442\u0430\u043c \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0442\u0440\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import datetime  for period in range(18):     date0 = (datetime.datetime.now() - datetime.timedelta(days = period*5 + 5)).strftime(\u2018%Y%m%d\u2019)     date1 = (datetime.datetime.now() - datetime.timedelta(days = period*5)).strftime(\u2018%Y%m%d\u2019)     df = sql_query(date0,date1)   # \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 sql \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434 &gt;=date0, &lt;date1     upload_temp_table(df=df, table_id=\u201dtemp_table\u201d, schema)  # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443     merge_tables(temp_table=\u2019temp_table\u2019, base_table = \u2018orders\u2019, schema=schema, head=[,,,], merge_param=\u2019id\u2019) <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c head \u2014 \u044d\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0415\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044f\u0432\u043d\u043e. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 SQL \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c MERGE-\u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432. \u041f\u0440\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u0434\u043b\u044f BQ \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435, \u0438 Python \u0441\u043c\u043e\u0436\u0435\u043c \u0441\u0430\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0438\u043f\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0445\u0435\u043c\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f BQ.<\/p>\n<p>  <\/p>\n<h3 id=\"rekomendacii\">\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import sys  log_file = open(\u201clog.txt\u201d, \u2018a\u2019) old_stdout = sys.stdout sys.stdout = log_file <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u0430\u0448 \u043a\u043e\u0434, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 print<br \/>  \u0418 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">sys.stdout = old_stdout log_file.close() <\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u0432\u044b\u0432\u043e\u0434\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b print \u043f\u043e\u0439\u0434\u0443\u0442 \u0432 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435, \u0434\u0430 \u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0441\u0431\u043e\u0435\u0432.<\/p>\n<p>  <\/p>\n<h3 id=\"epilog\">\u042d\u043f\u0438\u043b\u043e\u0433<\/h3>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b BigQuery \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0440\u043e\u043c, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043e\u0442\u0447\u0435\u0442 DataStudio (<a href=\"https:\/\/datastudio.google.com\/\">https:\/\/datastudio.google.com\/<\/a>) \u0438 \u043d\u0430\u0441\u0442\u043e\u0440\u043e\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0445\u043e\u0442\u044c DataStudio \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043b\u0443\u0447\u0448\u0435 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 BigQuery \u0438\u043b\u0438 \u0435\u0449\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0441\u0443\u043c\u043c\u0430 \u041d\u0414\u0421 \u043f\u043e \u0437\u0430\u043a\u0430\u0437\u0430\u043c, \u0430 \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043c\u043c\u0430 \u0438 \u043f\u0440\u043e\u0446\u0435\u043d\u0442, \u0442\u043e \u0441\u0443\u043c\u043c\u0443 \u041d\u0414\u0421 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u0437\u0430\u043b\u0438\u0432\u043e\u0447\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 apply.<\/p>\n<p>  <\/p>\n<p>\u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 DataStudio \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u043d\u0430 \u043b\u0435\u0442\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a), \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0438\u0433\u0434\u0435, \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0439 Datastudio \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0448\u044c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 Datastudio \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Blended Tables, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f LEFT JOIN \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446-\u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0438, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043b\u0443\u0447\u0448\u0435 \u0434\u0436\u043e\u0439\u043d\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0438\u043b\u0430\u043c\u0438 BigQuery. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0433\u0434\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0437\u0430\u043a\u0430\u0437\u0430\u043c\u0438 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0437\u0430\u043a\u0430\u0437\u043e\u0432, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e SQL-\u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0439 \u0432 BigQuery \u043f\u043e\u0434 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u042f \u0437\u043d\u0430\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e 6 \u0443\u0442\u0440\u0430, \u0437\u043d\u0430\u0447\u0438\u0442, \u0432 6 \u0447\u0430\u0441\u043e\u0432 \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 20 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u0438 70 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 3-4 \u043c\u0438\u043d\u0443\u0442\u044b \u0432 BigQuery. \u0412\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0430\u043a\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0435\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u0436\u0435 \u0438\u0445 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0422\u0443\u0442 \u0443\u0436\u0435 \u0434\u0435\u043b\u043e \u0432\u043a\u0443\u0441\u0430, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f. \u0427\u0442\u043e-\u0442\u043e \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0432 BigQuery, \u0430 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 Python. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f merge_tables \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 BQ \u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u041f\u0438\u0442\u043e\u043d\u0435, \u0442.\u043a. \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0433\u0447\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446 \u2014 \u0434\u0436\u043e\u0439\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0438\u043a\u043b\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0437\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 BigQuery \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Google Spreadsheets. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f id \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0438 \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 Python \u0432 pandas dataframe \u0438 \u0434\u0430\u043b\u0435\u0435 \u0434\u0436\u043e\u0439\u043d\u0438\u0442\u044c \u0441\u0438\u043b\u0430\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/li>\n<li>\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0432 BQ \u0438 \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 JOIN \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 BQ (\u043e\u043f\u044f\u0442\u044c-\u0442\u0430\u043a\u0438, \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043a\u0443\u0447\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u0440\u0438\u0442\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0440\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0443 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0441\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432 \u0434\u0435\u0441\u0442\u044f\u043a\u0438 \u0438 \u0441\u043e\u0442\u043d\u0438 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442, \u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u044e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u043c, \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u0438 \u043d\u0435\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0442\u0443\u0434\u0438\u0435\u0432\u0441\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u0432\u044b\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u0432 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446-\u0437\u0430\u043b\u0435, \u0438 \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u0430\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0445\u0440\u043e\u043c\u0435 \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043e\u0442\u0447\u0435\u0442\u043e\u043c (\u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 F5). \u041e\u043d \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f: Data Studio Auto-Refresh. \u0412 \u0438\u0442\u043e\u0433\u0435: \u0432\u0435\u0448\u0430\u0435\u043c \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0438\u043d\u0438\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0445\u0440\u043e\u043c\u0435 \u043e\u0442\u0447\u0435\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 View, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u043b\u0430\u0433\u0438\u043d Data Studio Auto-Refresh, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043b\u0438\u0448\u044c \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 SQL=&gt;BQ.<\/p>\n<p>  <\/p>\n<p>\u0410, \u043d\u0443 \u0438 \u0435\u0449\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u0438\u0437\u043d\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0443 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0447\u0435\u043c \u0434\u043e \u044d\u0442\u043e\u0433\u043e \ud83d\ude42<\/p>\n<\/div>\n<p> \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\/post\/504180\/\"> https:\/\/habr.com\/ru\/post\/504180\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504180\/\">\n<h3 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0437\u0430\u0434\u0430\u0447\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u0430 \u0434\u043e \u0443\u043d\u044b\u043d\u0438\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c \u043e\u0442\u0434\u0435\u043b\u0430 e-commerce \u043c\u0430\u043b\u043e\u0439 \u043a\u0440\u043e\u0432\u044c\u044e, \u0442.\u0435., \u0447\u0438\u0442\u0430\u0439, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0440\u043e\u043c.<\/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-304372","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304372","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=304372"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304372\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}