<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark optimum solution in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-optimum-solution/m-p/412368#M253408</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/131645"&gt;@Jack_sparrow&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That should be possible.&amp;nbsp;&lt;BR /&gt;You don't need to manually specify partitions or HDFS paths; Spark handles this automatically when you use a DataFrameReader.&lt;/P&gt;&lt;P&gt;First, you will need to read the source table using "spark.read.table()".&amp;nbsp;Since table is a Hive partitioned table, Spark will automatically discover and read all 100 partitions in parallel, as long as you have enough executors and cores available. Then, Spark creates a logical plan to read the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Repartition the data is next,&amp;nbsp;To ensure you have exactly 10 output partitions and to control the parallelism for the write operation, you can use the "repartition(10)" method. This will shuffle the data to create 10 new partitions, which will be processed by 10 different tasks.&lt;/P&gt;&lt;P&gt;And then, write the table.&amp;nbsp;Use "write.saveAsTable()".&amp;nbsp;You must specify the format using ".format("parquet")."&lt;/P&gt;</description>
    <pubDate>Tue, 16 Sep 2025 04:44:49 GMT</pubDate>
    <dc:creator>vafs</dc:creator>
    <dc:date>2025-09-16T04:44:49Z</dc:date>
    <item>
      <title>Spark optimum solution</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-optimum-solution/m-p/412342#M253391</link>
      <description>&lt;DIV class="votecell post-layout--left"&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-center gs4 fc-black-300"&gt;&lt;DIV class="js-vote-count flex--item d-flex fd-column ai-center fc-theme-body-font fw-bold fs-subheading py4"&gt;&lt;SPAN&gt;I'm having a Hive table emp1 with 100 partitions in Text format.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="postcell post-layout--right"&gt;&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I want Spark to read emp table based on partitions bases and write to EMP2 in parquet format. How to achieve 1) 10 Partition Read from EMP and parallel write to emp2. Making sure multiple executors are running and processing the data in parallel to convert data in short period. I don't want to use HDFS path.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Sep 2025 12:03:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-optimum-solution/m-p/412342#M253391</guid>
      <dc:creator>Jack_sparrow</dc:creator>
      <dc:date>2025-09-12T12:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spark optimum solution</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-optimum-solution/m-p/412368#M253408</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/131645"&gt;@Jack_sparrow&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That should be possible.&amp;nbsp;&lt;BR /&gt;You don't need to manually specify partitions or HDFS paths; Spark handles this automatically when you use a DataFrameReader.&lt;/P&gt;&lt;P&gt;First, you will need to read the source table using "spark.read.table()".&amp;nbsp;Since table is a Hive partitioned table, Spark will automatically discover and read all 100 partitions in parallel, as long as you have enough executors and cores available. Then, Spark creates a logical plan to read the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Repartition the data is next,&amp;nbsp;To ensure you have exactly 10 output partitions and to control the parallelism for the write operation, you can use the "repartition(10)" method. This will shuffle the data to create 10 new partitions, which will be processed by 10 different tasks.&lt;/P&gt;&lt;P&gt;And then, write the table.&amp;nbsp;Use "write.saveAsTable()".&amp;nbsp;You must specify the format using ".format("parquet")."&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2025 04:44:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-optimum-solution/m-p/412368#M253408</guid>
      <dc:creator>vafs</dc:creator>
      <dc:date>2025-09-16T04:44:49Z</dc:date>
    </item>
  </channel>
</rss>

