{"id":359567,"date":"2024-05-21T00:35:14","date_gmt":"2024-05-21T00:35:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=359567"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=359567","title":{"rendered":"<span>\u0414\u0435\u0436\u0443\u0440\u043d\u044b\u0439 data-\u0438\u043d\u0436\u0435\u043d\u0435\u0440: \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0445\u0440\u043e\u043d\u0438\u043a\u0438<\/span>"},"content":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/vk.com\/rtrg?p=VK-RTRG-541074-aOhpd&amp;event=habr_bigdata\" style=\"display:none;\" width=\"1\"><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/vk.com\/rtrg?p=VK-RTRG-541074-aOhpd&amp;event=habr_dbaas\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/pw\/6p\/2z\/pw6p2zkno6nth4ea-fsgyeigtlm.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/pw\/6p\/2z\/pw6p2zkno6nth4ea-fsgyeigtlm.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 VK Cloud \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a data-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e\u0441\u0442\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0445 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041e\u0442 Pandas \u043a pandas_on_spark<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0438\u0437 Airflow, \u043d\u043e airflow task, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0432\u0448\u0438\u0439 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0443\u043f\u0430\u043b. \u0412 \u043b\u043e\u0433\u0435 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b Driver Pod \u0432 Kubernetes \u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code class=\"plaintext\">State: Terminated Reason: OOMKilled Exit Code: 137 <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u043e\u043c \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u043a\u043e\u0434 \u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Spark \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Pandas. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435 Spark \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>toPandas<\/code>, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044f \u0438\u0445 \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c Pandas. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 executors \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0438\u0445 \u0432 driver, \u0443 driver \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>  \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c API pandas_on_spark, \u0430 \u043d\u0435 Pandas. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<h2>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Class not found (\u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Spark)<\/h2>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Spark 3.2 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 class not found. \u042f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043a\u043e\u0434 \u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441 \u0441\u0442\u0430\u043b \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u043c.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 PyArrow<\/h2>\n<p>  \u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0441\u0440\u0435\u0434\u0435 conda \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u043b \u0432\u0435\u0440\u0441\u0438\u044e numpy. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">pyarrow.lib.check_status\u00a0pyarrow.lib.ArrowTypeError: Did not pass numpy.dtype object&lt;\/i><\/code><\/pre>\n<p><\/i><br \/>  \u041f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e PyArrow \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 conda \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 4.0.1, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c.<\/p>\n<h2>Insert Overwrite \u0432 \u0442\u0443 \u0436\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044e<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0432 Spark 2.3, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 Spark 3.2. \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">Analysis Exception: Cannot overwrite a path that is also being read from. <\/code><\/pre>\n<p><\/i><br \/>  \u041c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c insert overwrite \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0442\u043e\u0439 \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 Spark \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0443\u0442\u044c \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u043d\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u0438 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u042d\u0442\u043e \u043d\u0435\u0440\u0435\u0448\u0451\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 Spark. \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>false<\/code> \u0434\u043b\u044f <code>convertMetastoreParquet<\/code>, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f insert overwrite Spark \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Hive Serde, \u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0421 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Hive Serde \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 staging dir.<\/p>\n<p>  \u041a\u043e\u043c\u043c\u0438\u0442 Spark \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:\u00a0<a href=\"https:\/\/github.com\/apache\/spark\/pull\/35608\">https:\/\/github.com\/apache\/spark\/pull\/35608<\/a><\/p>\n<h2>\u041d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b<\/h2>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">org.apache.spark.sql.AnalysisException: Reference is ambiguous <\/code><\/pre>\n<p><\/i><br \/>  \u0418\u0437\u0443\u0447\u0430\u044f \u043a\u043e\u0434, \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0432 join, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u043b\u0441\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u041a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u00a0<code>select($\"joined_df1.*\")<\/code>. \u042d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 Spark: \u043e\u043d \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 star-\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f alias \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043b \u0432 \u0431\u044d\u043a\u043b\u043e\u0433\u0435 \u0442\u0438\u043a\u0435\u0442 \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>  \u041a\u043e\u043c\u043c\u0438\u0442 Spark \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/apache\/spark\/pull\/40258\">https:\/\/github.com\/apache\/spark\/pull\/40258<\/a>  <\/li>\n<li><a href=\"https:\/\/github.com\/apache\/spark\/pull\/36763\">https:\/\/github.com\/apache\/spark\/pull\/36763<\/a>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041f\u0430\u0434\u0435\u043d\u0438\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438<\/h2>\n<p>  Spak-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u0431\u043e\u0435\u043c. \u0412 \u043b\u043e\u0433\u0430\u0445 \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">An Error occurred while calling o5331.saveAsTable java.lang.OutOfMemoryError: Java Heap Space <\/code><\/pre>\n<p><\/i><br \/>  \u0418\u0437\u0443\u0447\u0438\u0432 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 executors \u043d\u0430 history server, \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435\u0440\u0430\u0432\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439: \u0432 \u043e\u0434\u043d\u0438\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0435\u043c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0438\u0441\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0434\u0435\u043b\u0430\u043b executor, \u0432 \u043a\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>repartitioning<\/code> \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430, \u0432 \u00ab\u043f\u0435\u0440\u0435\u043a\u043e\u0448\u0435\u043d\u043d\u043e\u0439\u00bb \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 OOM. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d-\u0441\u0440\u0435\u0434\u0435, \u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c executor; \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0451\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0441\u044f, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u043e \u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>repartition<\/code>.<\/p>\n<h2>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Null \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 Spark \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Hive<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 Spark SQL. \u041d\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0442\u043e\u0439 \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 Hive \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<br \/>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Spark \u0438 Hive \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0444\u0430\u0439\u043b\u044b ORC. \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Spark Query, \u0443\u043a\u0430\u0437\u0430\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>false<\/code> \u0434\u043b\u044f <code>convertMetastoreORC<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e Spark \u0441\u0442\u0430\u043b \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0447\u0442\u043e \u0438 Hive.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u00abSpark local dir full\u00bb<\/h2>\n<p>  \u041e\u0434\u043d\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043e \u0441\u0431\u043e\u0435\u043c. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043b\u043e\u0433\u0438, \u044f \u043d\u0430\u0448\u0451\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">java.nio.file.FileSystemException: No space left on device <\/code><\/pre>\n<p><\/i><br \/>  \u0422\u0430\u043a\u043e\u0435 \u0431\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f Scratch space (spark.local.dir). \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0438\u0441\u043a, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f. \u0422\u0430\u043a \u043a\u0430\u043a Spark \u0443 \u043d\u0430\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes, \u0442\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c daemonset \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043d\u043e\u0434\u044b. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u043e\u0442 \u0436\u0435 daemonset, \u0447\u0442\u043e\u0431\u044b \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0434\u0438\u0441\u043a \u043d\u0430 \u044d\u0442\u043e\u0439 \u043d\u043e\u0434\u0435, \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<h2>\u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 broadcast hint<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044fjoin hint. \u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u044b\u043b \u043e\u043a\u043e\u043b\u043e 800 \u041c\u0431\u0430\u0439\u0442. \u0418\u0437 \u043a\u043e\u0434\u0430 \u0431\u044b\u043b\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043b alias \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u043e \u0432 hint\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435\u0438\u043c\u044f. \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 hint alias, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043b\u0430\u043d Spark \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e broadcast \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b.<\/p>\n<h2>PySpark \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Python 3.8 \u0432 Livy<\/h2>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 PySpark \u0441 Python 3.8 \u0447\u0435\u0440\u0435\u0437 Livy \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">TypeError: required field \"type_ignores\" missing from Module <\/code><\/pre>\n<p><\/i><br \/>  Python 3.8 \u0432\u043d\u0451\u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 API \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432\u044b\u0437\u0432\u0430\u043b \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441 Livy \u0432 \u044d\u0442\u043e\u0442 PR: <a href=\"https:\/\/github.com\/apache\/incubator-livy\/pull\/314\/files\">LIVY-795<\/a><\/p>\n<h2>Null Pointer Exception \u0432 PySpark<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043e\u0431 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d-\u0441\u0440\u0435\u0434\u0435.<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">java.lang.NullPointerException at  org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.project_subExpr_5$(Unknown Source) at  org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source) at  org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:35)<\/code><\/pre>\n<p><\/i><br \/>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0445\u0435\u043c\u0430 Parquet (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0430) \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445.<\/p>\n<ul>\n<li>\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0432\u0441\u0451 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u043c, \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c (union).<\/li>\n<li>\u0421\u043b\u0435\u0434\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445 \u0438\u043c\u0435\u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0431\u044b\u043b\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438.<\/li>\n<li>\u0412 \u0441\u0430\u043c\u043e\u043c \u043e\u0431\u0449\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435:<br \/> \n<ul>\n<li>\u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0445\u0435\u043c\u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438.<\/li>\n<li>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u0445\u0435\u043c\u0430\u043c\u0438.<\/li>\n<li>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0432 JSON RDD, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439.<\/li>\n<\/ul>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0421\u0431\u043e\u0439 executor \u0438\u0437-\u0437\u0430 OOM<\/h2>\n<p>  \u041e\u0434\u0438\u043d executor Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0438\u043b \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u0438\u0437-\u0437\u0430 OOM. \u0418\u0437\u0443\u0447\u0438\u0432 \u043a\u043e\u0434, \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>coalesce(8)<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <code>repartition(8)<\/code> \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0441\u0442\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0443 executor \u0438\u0441\u0447\u0435\u0437\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 OOM.<\/p>\n<h2>\u041d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0438 \u0432 Hive Metastore<\/h2>\n<p>  \u0421\u0431\u043e\u0439 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<pre><code class=\"plaintext\">>> spark.sql(\"select max(&lt;partition_col>) from schema.table_name\")  Caused by: java.util.concurrent.ExecutionException:\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0org.apache.hadoop.mapred.InvalidInputException:\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Input path does not exist: <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 Metastore \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. Spark \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 (\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\u00a0 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435) \u0438\u0437 HMS, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b, \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f \u0442\u0430\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, Spark \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443. \u0423\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<p>  1. <b>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0MSCK REPAIR\u00a0\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Hive.<\/b> \u041e\u043d \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u043c\u0438, \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a Hive \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043b\u0430\u0435\u043d\u0441\u0430) \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439, \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043d\u0451\u043c.<\/p>\n<pre><code class=\"plaintext\">MSCK REPAIR TABLE table_identifier [{ADD|DROP|SYNC} PARTITIONS]  # ADD - adds new partitions (DEFAULT) # DROP - drops all partitions from the session catalog that have non-existing locations # SYNC - combination of DROP and ADD.<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<code>ALTER TABLE table_identifier RECOVER PARTITIONS.<\/code><\/p><\/blockquote>\n<p>  2.\u00a0<b>verifyPartitionPath.<\/b> \u042d\u0442\u043e \u043d\u0435\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439 \u0444\u043b\u0430\u0433; \u0435\u0441\u043b\u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0435\u0433\u043e, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u041e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442 Spark \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 HMS \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439, \u0441\u0440\u0430\u0432\u043d\u0438\u0432 \u0438\u0445 \u0441 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u0438 \u0432 Hive. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439, \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\u00a0<\/p>\n<pre><code class=\"plaintext\">spark.sql.hive.verifyPartitionPath=true <\/code><\/pre>\n<p>  3.\u00a0<b>ignoreMissingFiles.<\/b> \u042d\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 Spark \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0444\u0430\u0439\u043b\u044b. \u0411\u0435\u0437\u043e\u0442\u043a\u0430\u0437\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e. \u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433, Spark \u043e\u0442\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f file not found \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0445, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435.<code>\u00a0spark.files.ignoreMissingFiles=true<\/code>.<\/p>\n<p>  4.\u00a0<b>spark.sql.optimizer.metadataOnly.<\/b> \u042d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u041e\u043d \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 Spark \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445, \u043d\u043e \u0432 Hive \u0435\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.\u00a0<code>spark.sql.optimizer.metadataOnly=true<\/code><\/p>\n<h2>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f, \u0447\u0442\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0431\u043e\u0438\u0442\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 GC overhead.<\/p>\n<pre><code class=\"java\">INFO yarn.ApplicationMaster:  \u00a0 \u00a0 Unregistering ApplicationMaster with FAILED (diag message: User class threw exception:  \u00a0 \u00a0 \u00a0 \u00a0 java.lang.OutOfMemoryError:  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 GC overhead limit exceeded <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u0451\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b 32 \u0413\u0431\u0430\u0439\u0442. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043a\u0443\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u0448\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041d\u0430\u0448\u0451\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 (\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0432 Pyspark \u0438\u0437 Scala):<\/p>\n<pre><code class=\"scala\">df = Empty DF for files_metadata in file_metadata_list: # 10 items  \u00a0 \u00a0 for files_location in files_metadata: # 60 locations \u00a0 \u00a0 \u00a0 \u00a0 cur_df = spark.read.parquet(files_location) \u00a0 \u00a0 \u00a0 \u00a0 cur_df = cur_df.withColumn(\"new col\", \"logic based on files_metadata\") \u00a0 \u00a0 \u00a0 \u00a0 df = df.union(cur_df) <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u044b (600). \u0414\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0442\u0440\u0443\u0434\u043d\u043e \u0432\u044b\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443. \u0422\u043e \u0436\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u043e\u0441\u044c \u0438 \u0432 JVM heap dump.<\/p>\n<pre><code class=\"scala\">def assign_col_based_on_metadata(col_val): \u00a0 \u00a0 \u2018''  \u00a0 \u00a0 logic here  \u00a0 \u00a0 ''' \u00a0 \u00a0 return new_val  helper_udf = udf(assign_col_based_on_metadata, returnType)  df = spark.read.parquet(glob_exp) df = df.withColumn(\"file_name\", input_file_name()) df = df.withColumn(\"new col\", helper_udf(file_name)) <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 GC overhead.<\/p>\n<h2>\u041f\u043e\u0438\u0441\u043a \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u0435\u0433\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u0418\u0437\u0443\u0447\u0438\u0432 \u043a\u043e\u0434, \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043f\u043e\u0438\u0441\u043a \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u0412 \u043e\u0431\u0435\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0431\u044b\u043b\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u044b \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"scala\">select a.* from huge_table a where a.id not in (select id from big_table) <\/code><\/pre>\n<p>  \u041e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0447\u0430\u0441\u0430. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c LEFT ANTI JOIN.<\/p>\n<pre><code class=\"scala\">SELECT a.* FROM huge_table a LEFT ANTI JOIN big_table b ON a.id = b.id <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0448\u043b\u043e \u0432\u043e\u0441\u0435\u043c\u044c \u043c\u0438\u043d\u0443\u0442.<\/p>\n<h2>\u0427\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043d\u0438\u0437\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u043e \u0436\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0451\u043c\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 stage, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043e\u0431\u044a\u0451\u043c\u044b \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (shuffle). \u041a\u043e\u0434, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"scala\">def aggregate_calls(df, t_age, agg_func): \u00a0 \u00a0 return df.filter(df['t_age'] &lt;= t_age).groupBy('pos_type').agg(agg_func)  agg_funcs = [F.sum('t_amount'), F.count('*'), F.avg('t_amount')]  transaction_age = [1, 7, 15, 30, 90]  for t_age, agg_func in itertools.product(transaction_age, agg_funcs): \u00a0 \u00a0 result = aggregate_calls(df, t_age, agg_func) \u00a0 \u00a0 # other business logic <\/code><\/pre>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u0441\u0451 \u044f\u0441\u043d\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0451\u043b \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043e\u0431\u044a\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e\u00a0<code>groupBy<\/code>. \u041d\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0438\u00a0<code>groupBy<\/code>\u00a0\u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430, \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (shuffle) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.<\/p>\n<p>  \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0432 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441\u0430\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<pre><code class=\"scala\">aggregations = []  for t_age in [1, 7, 15, 30, 90]: \u00a0 \u00a0 aggregations.extend([ \u00a0 \u00a0 \u00a0 \u00a0 F.sum(F.when(df['t_age'] &lt;= t_age, df['t_amount'])).alias(f'total_transcation_amount_last_{t_age}_days'), \u00a0 \u00a0 \u00a0 \u00a0 F.count(F.when(df['t_age'] &lt;= t_age, True)).alias(f'num_transaction_last_{t_age}_days'), \u00a0 \u00a0 \u00a0 \u00a0 (F.sum(F.when(df['t_age'] &lt;= t_age, df['t_amount'])) \/ F.count(F.when(df['t_age'] &lt;= t_age, True))).alias(f'avg_tran_amount_last_{days}_days') \u00a0 \u00a0 ]) result = df.groupBy('pos_type').agg(*aggregations) <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0446\u0438\u043a\u043b, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043d\u0435\u0439. \u042d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0434\u043e 1.<\/p>\n<h2>Spark History Server \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/h2>\n<p>  \u0421 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  Spark History Server \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 level_db\/rocks_db \u0434\u043b\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0430 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u044b\u0445 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c, \u0430 \u0434\u0438\u0441\u043a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 level_db, \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443\u00a0<b>spark.history.store.path<\/b>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Spark History Server.<\/p>\n<h2>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0445\u0432\u0430\u0442\u0430\u043b\u043e 30 \u043c\u0438\u043d\u0443\u0442, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043e\u0442 \u0443\u0436\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0447\u0430\u0441\u0430 \u0438 \u0435\u0449\u0451 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 Spark History Server, \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u0431\u043e\u043b\u044c\u0448\u0435 2,5 \u0442\u044b\u0441\u044f\u0447\u0438). \u042f \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u044d\u0442\u043e \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u043d\u0438: \u0440\u0430\u043d\u044c\u0448\u0435 \u044d\u0442\u0438 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0437\u0430 300 \u043c\u0441. \u041a\u043e\u043f\u043d\u0443\u043b \u0433\u043b\u0443\u0431\u0436\u0435: \u0431\u044b\u043b \u0432\u044b\u0437\u043e\u0432 \u0411\u0414 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0436\u0443\u0440\u043d\u0430\u043b Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 4\u20135 \u0441\u0435\u043a\u0443\u043d\u0434. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b\u0430\u0441\u044c \u043d\u0438\u0437\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0411\u0414 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u0430 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414 \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0432 40 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<h2>\u041f\u0440\u043e\u043b\u0435\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0438\u0433\u043e\u0440\u0438\u0430\u043d\u0441\u043a\u0438\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c<\/h2>\n<p>  <\/p>\n<pre><code class=\"scala\">Caused by: org.apache.spark.SparkUpgradeException: \u00a0 \u00a0 Spark 3.0+'s Proleptic Gregorian calendar. <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. Spark 3.2 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u0444\u0430\u0439\u043b, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 Spark 2.3, \u0430 \u0432 \u0441\u0442\u0430\u0440\u043e\u0439 \u0434\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442. \u0412 Spark \u0432\u0435\u0440\u0441\u0438\u0438 2.4 \u0438 \u0440\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c (<a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/util\/GregorianCalendar.html\">\u044e\u043b\u0438\u0430\u043d\u0441\u043a\u0438\u0439 + \u0433\u0440\u0438\u0433\u043e\u0440\u0438\u0430\u043d\u0441\u043a\u0438\u0439<\/a>), \u0430 \u0432 Spark 3.2 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043b\u0435\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0438\u0433\u043e\u0440\u0438\u0430\u043d\u0441\u043a\u0438\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0434\u0430\u0442\u044b \u0434\u043e 15 \u043e\u043a\u0442\u044f\u0431\u0440\u044f 1582 \u0433\u043e\u0434\u0430 (\u0433\u0440\u0438\u0433\u043e\u0440\u0438\u0430\u043d\u0441\u043a\u043e\u0435 \u043b\u0435\u0442\u043e\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435). Spark 3.2 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u0432\u0438\u0434\u0438\u0442 \u0441\u0442\u0430\u0440\u044b\u0435 \u0434\u0430\u0442\u044b \u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438, \u0438 \u0435\u043c\u0443 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044e \u043e\u043d\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f.<\/p>\n<pre><code class=\"plaintext\">--conf spark.sql.parquet.datetimeRebaseModeInRead=CORRECTED  --conf spark.sql.parquet.datetimeRebaseModeInWrite=CORRECTED <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, Spark \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u0442\u044b \u0438 \u043c\u0435\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u0430\u043a \u0435\u0441\u0442\u044c.<\/p>\n<h2>\u0417\u0430\u043f\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 df.write.insertInto<\/h2>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>df.write.insertInto<\/code> \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u00a0<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">df.write.mode(\u2018append\u2019).insertInto(\u2018mybigtable\u2019) <\/code><\/pre>\n<p><\/i><br \/>  \u041e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"java\">org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out at org.apache.hadoop.hive.ql.metadata.Hive.getPartitions(Hive.java:2562) at org.apache.spark.sql.hive.HiveExternalCatalog.listPartitions(HiveExternalCatalog.scala:1238) at org.apache.spark.sql.catalyst.catalog.ExternalCatalogWithListener.listPartitions(ExternalCatalogWithListener.scala:254) at org.apache.spark.sql.catalyst.catalog.SessionCatalog.listPartitions(SessionCatalog.scala:1234) at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand.run(InsertIntoHadoopFsRelationCommand.scala:101) at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:30) at org.apache.spark.sql.DataFrameWriter.insertInto(DataFrameWriter.scala:436) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/d3\/b_\/wo\/d3b_wobcywdamkvcha3zxolgb5m.png\" data-src=\"https:\/\/habrastorage.org\/webt\/d3\/b_\/wo\/d3b_wobcywdamkvcha3zxolgb5m.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u044b\u0448\u0435, Spark \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b Hive Metastore, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445. Spark \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 API <code>getPartition()<\/code> \u0432 Hive 2.3.9 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f\u0445 \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432. \u0418\u0437-\u0437\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0439 (<sup>~<\/sup>6L) \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u0432 2 \u0413\u0431\u0430\u0439\u0442, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0441\u043e\u043a\u0435\u0442\u0430. \u042d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\u0412\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 API \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 Hive (<a href=\"https:\/\/github.com\/apache\/hive\/pull\/4501\">Hive 27505<\/a>).  <\/li>\n<li>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 Hive Serde \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>false<\/code> \u0434\u043b\u044f <code>spark.sql.hive.convertMetastoreOrc <\/code>\u0438\u043b\u0438 <code>spark.sql.hive.convertMetastoreParquet<\/code>.  <\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430<\/h2>\n<p>  \u041a\u0430\u0442\u0430\u043b\u043e\u0433 Spark \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 Hive.<\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0435 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u0443 \u0438\u043b\u0438 \u0438\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 Kafka topic \u0438 \u043d\u0430 \u0435\u0451 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Hive. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435 \u0443\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0451 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/oi\/hu\/rl\/oihurlnsmud129fehywd7lfrml8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/oi\/hu\/rl\/oihurlnsmud129fehywd7lfrml8.png\"\/><\/p>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.4 Spark \u043a\u0435\u0448\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b; \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c REFRESH TABLE, \u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 Spark \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f.<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">spark.sql.metadataCacheTTLSeconds 180s spark.sql.catalogImplementation hive <\/code><\/pre>\n<p><\/i><br \/>  \u0421\u0441\u044b\u043b\u043a\u0430:\u00a0<a href=\"https:\/\/issues.apache.org\/jira\/browse\/SPARK-30616\">SPARK-30616<\/a><\/p>\n<h2>\u041f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code class=\"java\">org.apache.spark.SparkException: Job aborted due to stage failure: ExecutorLostFailure (executor 4 exited caused by one of the running tasks)  Reason: Container from a bad node: container_xxx_xx_000009 on host: xx.xx.com. Exit status: 50.<\/code><\/pre>\n<p>  \u0412 \u043b\u043e\u0433\u0435 executor \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<pre><code class=\"java\">ERROR Executor: Exception in task 102.0 in stage 884.0 (TID 31106) java.lang.StackOverflowError \u00a0 \u00a0 at org.codehaus.janino.CodeContext.extract16BitValue(CodeContext.java:763) \u00a0 \u00a0 at org.codehaus.janino.CodeContext.flowAnalysis(CodeContext.java:600) \u00a0 \u00a0 at org.codehaus.janino.CodeContext.flowAnalysis(CodeContext.java:600) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/8m\/0q\/yl\/8m0qylozrkdobnv-e4ronom9hzs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/8m\/0q\/yl\/8m0qylozrkdobnv-e4ronom9hzs.png\"\/><\/p>\n<p>  \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u044b\u0448\u0435 \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c executor. \u041d\u043e \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043a\u0430, \u043e\u043d\u0430 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441\u0442\u0435\u043a\u0430 Java.<\/p>\n<p>  Spark \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 JVM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>extraJavaOptions<\/code>, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 Spark.<\/p>\n<pre><code class=\"java\"># set stack size to 1G \"spark.executor.extraJavaOptions=-Xss1G\"\u00a0 <\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u0443\u0441\u0442\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code class=\"java\">Caused by: org.apache.spark.SparkException: Dataset transformations and actions can only be invoked by the driver, not inside of other Dataset transformations. <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 Spark \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432, \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 SparkContext \u0438 SparkSession \u043e\u0431\u043d\u0443\u043b\u044f\u044e\u0442\u0441\u044f (\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>@transient<\/code> \u0438\u043b\u0438 \u043e\u0431\u043d\u0443\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Closure Cleaner). \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 (\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f), \u0432\u0438\u0434\u044f\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b <code>persist<\/code> \u0434\u043b\u044f \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0438 \u043f\u043e\u0442\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>sparkContext.broadcast<\/code> \u0441 broadcast \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043d\u0435\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e. \u042d\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<pre><code class=\"java\"># order of method call df.cache df.broadcast df.apply() <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c broadcast \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u0438 \u043a\u043e\u0434 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<h2>\u041d\u0435\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>  <\/p>\n<pre><code class=\"java\">error: type mismatch; found \u00a0 : org.apache.spark.sql.types.DecimalType.type required: org.apache.spark.sql.types.DataType \u00a0 \u00a0 \u00a0 \u00a0 StructField(\"col_name\", DecimalType, true) <\/code><\/pre>\n<p>  <b>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 Hive \u0438 Parquet<\/b><\/p>\n<p>  \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0445\u0435\u043c\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 Hive \u0438 Parquet \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f.<\/p>\n<ol>\n<li>Parquet \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d \u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443, \u0430 Hive \u2014 \u043d\u0435\u0442.  <\/li>\n<li>Hive \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null, \u0430 \u0432 Parquet \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 null \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  <\/li>\n<\/ol>\n<p>  \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 Parquet \u0438\u0437 Hive Metastore \u0432 Spark SQL, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 Hive Metastore \u0438 \u0441\u0445\u0435\u043c\u0443 Parquet.\u00a0<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f:\u00a0<\/p>\n<ul>\n<li>\u0423 \u043f\u043e\u043b\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0432 \u043e\u0431\u0435\u0438\u0445 \u0441\u0445\u0435\u043c\u0430\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 null.\u00a0  <\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c, \u0443 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0432 Parquet.  <\/li>\n<\/ul>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u0441\u0445\u0435\u043c\u0435 Hive Metastore.<\/p>\n<ul>\n<li>\u041f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0445\u0435\u043c\u0435 Parquet, \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435.  <\/li>\n<li>\u041f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0445\u0435\u043c\u0435 Hive Metastore, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u0430\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null.  <\/li>\n<\/ul>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b Parquet \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043d\u0451\u043c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Hive.<\/p>\n<h2>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u0435\u0440\u0441\u0438\u0439 Scala\u00a0<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"javascript\">java.lang.ClassCastException: cannot assign instance of scala.None$ to field  org.apache.spark.scheduler.Task.appAttemptId of type scala.Option in instance of  org.apache.spark.scheduler.ResultTask . . . at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:76) at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:115) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:466) <\/code><\/pre>\n<p>  \u041e\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u0438 Scala \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432 Spark \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u042f \u0438\u0437\u0443\u0447\u0438\u043b Spark \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 (\u0432\u043a\u043b\u0430\u0434\u043a\u0430 Environment \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435) \u0438 \u0443\u0437\u043d\u0430\u043b \u0432\u0435\u0440\u0441\u0438\u044e Scala, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0432 <code>classpath<\/code>.<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">Java Home \u2014 \/usr\/mware\/jdk8u352\/jre Java Version \u2014 1.8.0_352 Scala Version \u2014 version 2.12.15 <\/code><\/pre>\n<p><\/i><br \/>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0432\u0435\u0440\u0441\u0438\u044e Scala \u0432 App Jar. \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430\u0441\u044c \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432 <code>classpath<\/code> \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Scala. \u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 pom \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u0441\u0447\u0435\u0437\u043b\u0430.<\/p>\n<h2>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code class=\"java\">IllegalArgumentException: Cannot grow BufferHolder error.  \u00a0 java.lang.IllegalArgumentException: C annot grow BufferHolder by size 95969 because the size after growing exceeds size limitation 2147483632 <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f \u00a0<code>BufferHolder<\/code> \u0438\u043c\u0435\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 2 147 483 632 \u0431\u0430\u0439\u0442\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2 \u0413\u0431\u0430\u0439\u0442). \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043b\u0438 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c repartition \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0432\u0443\u0445 \u043a\u043b\u044e\u0447\u0435\u0439, \u0430 \u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0438 \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<h2>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439<\/h2>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code class=\"java\">java.lang.StackOverflowError at org.apache.spark.sql.catalyst.trees.TreeNode$$Lambda$5466\/589672638.get$Lambda(Unknown Source) \u00a0 \u00a0 \u00a0 at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$mapChildren$1(TreeNode.scala:777) \u00a0 \u00a0 \u00a0 at org.apache.spark.sql.catalyst.trees.TreeNode.mapProductIterator(TreeNode.scala:427)<\/code><\/pre>\n<p>  \u0418\u0437\u0443\u0447\u0438\u043b\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u043d Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0441\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439\u00a0<code>withColumn<\/code>, \u0438 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0441\u0442\u0435\u043a JVM.<\/p>\n<p>  \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1024 \u041a\u0431\u0430\u0439\u0442, \u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u00a04 \u041c\u0431\u0430\u0439\u0442, \u0443\u043a\u0430\u0437\u0430\u0432 \u0434\u043b\u044f <code>spark.driver.extraJavaOptions<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>-Xss4M<\/code>.<\/p>\n<h2>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u043e\u0439 OOM \u0432 Java Heap space. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Stage \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0432\u0435\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/uj\/qu\/xc\/ujquxcaymswbl_c9ktkimrf_i_4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/uj\/qu\/xc\/ujquxcaymswbl_c9ktkimrf_i_4.png\"\/><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 Failed, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0441\u0431\u043e\u044e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rr\/sy\/to\/rrsytoyfrgxcwxlcbuh97ij5vl8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rr\/sy\/to\/rrsytoyfrgxcwxlcbuh97ij5vl8.png\"\/><\/p>\n<p>  \u042f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u0441\u0431\u043e\u044f:<\/p>\n<p>  <i><\/p>\n<pre><code class=\"plaintext\">spark.memory.fraction 0.8 spark.memory.storageFraction 0.4&lt;\/i> <\/code><\/pre>\n<p><\/i><br \/>  \u042f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440 executor \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b 28 \u0413\u0431\u0430\u0439\u0442, \u0430 \u0443 \u043d\u0430\u0441 executors \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 32 \u0413\u0431\u0430\u0439\u0442.<\/p>\n<blockquote><p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a Telegram-\u043a\u0430\u043d\u0430\u043b\u0443 <a href=\"https:\/\/t.me\/+mRmjbHoS0qoxMDAy\">\u00ab\u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445\u00bb<\/a>. \u0412 \u043d\u0451\u043c \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0432\u0441\u0451 \u043e\u0431 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u0445 \u043a \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b \u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438: \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u044b, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u043d\u043e\u043d\u0441\u044b \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0439 \u0438 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u043e\u0432.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/772468\/\"> https:\/\/habr.com\/ru\/articles\/772468\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/vk.com\/rtrg?p=VK-RTRG-541074-aOhpd&amp;event=habr_bigdata\" style=\"display:none;\" width=\"1\"><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/vk.com\/rtrg?p=VK-RTRG-541074-aOhpd&amp;event=habr_dbaas\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/pw\/6p\/2z\/pw6p2zkno6nth4ea-fsgyeigtlm.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/pw\/6p\/2z\/pw6p2zkno6nth4ea-fsgyeigtlm.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 VK Cloud \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a data-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e\u0441\u0442\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0445 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442.  <\/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-359567","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359567","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=359567"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359567\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}