<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rafael Lucas Chagas on Medium]]></title>
        <description><![CDATA[Stories by Rafael Lucas Chagas on Medium]]></description>
        <link>https://medium.com/@rafaellucaschagas?source=rss-79c34c8f588d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Tw3Q2-tH73Zm67nNjzYi7w.png</url>
            <title>Stories by Rafael Lucas Chagas on Medium</title>
            <link>https://medium.com/@rafaellucaschagas?source=rss-79c34c8f588d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 07:48:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rafaellucaschagas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Trino for Iceberg Table Maintenance]]></title>
            <link>https://medium.com/@rafaellucaschagas/using-trino-for-iceberg-table-maintenance-569d084b6982?source=rss-79c34c8f588d------2</link>
            <guid isPermaLink="false">https://medium.com/p/569d084b6982</guid>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[trinos]]></category>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Rafael Lucas Chagas]]></dc:creator>
            <pubDate>Tue, 27 May 2025 18:36:10 GMT</pubDate>
            <atom:updated>2025-05-27T18:36:10.946Z</atom:updated>
            <content:encoded><![CDATA[<p>With the growing popularity of Trino alongside Apache Iceberg, also known as Icehouse, the need for effective table maintenance becomes essential.</p><p>However, performing such maintenance tasks manually can be quite challenging.</p><p>With this issue in mind, I decided to create an Apache Airflow operator to automate these tasks,</p><h3><strong>What operations does this operator perform?</strong></h3><p><strong>Table Optimization:</strong></p><pre>ALTER TABLE my_iceberg_table EXECUTE OPTIMIZE;</pre><p><strong>Expiring Snapshots:</strong></p><pre>ALTER TABLE my_iceberg_table EXECUTE EXPIRE_SNAPSHOTS(RETENTION_THRESHOLD =&gt; &#39;7d&#39;);</pre><p><strong>Removing Orphan Files:</strong></p><pre>ALTER TABLE my_iceberg_table EXECUTE REMOVE_ORPHAN_FILES(RETENTION_THRESHOLD =&gt; &#39;7d&#39;);</pre><p><strong>Dropping Extended Statistics:</strong></p><pre>ALTER TABLE my_iceberg_table EXECUTE DROP_EXTENDED_STATS;</pre><p><strong>Table Analysis:</strong></p><pre>ANALYZE my_iceberg_table;</pre><p>To use the operator, simply create a connection to your chosen Trino environment and copy the code below into your Airflow setup: <em>/plugins/custom_operator/</em></p><pre>from custom_operator.trino_iceberg_table_maintenance import TrinoIcebergTableMaintanance<br><br><br>with dag:<br>    hello_task = TrinoIcebergTableMaintanance(<br>    task_id=&quot;sample-task&quot;, <br>    table_name=&quot;my_iceberg_catalog.my_iceberg_schema.my_iceberg_table&quot;,<br>    conn_id=&quot;my_trino_connection&quot;<br>)</pre><p>Link for the github repository:</p><p><a href="https://github.com/ShuffleMind/airflow/">https://github.com/ShuffleMind/airflow/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=569d084b6982" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trino para manutenção de tabelas Iceberg]]></title>
            <link>https://medium.com/@rafaellucaschagas/trino-para-manuten%C3%A7%C3%A3o-de-tabelas-iceberg-c442153001c7?source=rss-79c34c8f588d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c442153001c7</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <dc:creator><![CDATA[Rafael Lucas Chagas]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 19:06:49 GMT</pubDate>
            <atom:updated>2024-12-05T19:06:49.595Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Utilizando Trino para manutenção de tabela Iceberg</em></p><p>Com a crescente adesão do uso de Trino com Apache Iceberg também conhecido como Icehouse, surge a necessidade de se realizar manutenções nessas tabelas.</p><p>Porém, realizar esse tipo de trabalho de forma manual, pode ser um tanto desafiador.</p><p>Pensando nessa problemática, resolvi criar um operator de Apache Airflow para automatizar essa tarefa.</p><h3><em>Quais operações esse operador realiza ?</em></h3><p><strong><em>Table optimize:</em></strong></p><pre>alter table my_iceberg_table execute optimize</pre><p><strong><em>Expire snapshots:</em></strong></p><pre>alter table my_iceberg_table execute expire_snapshots(retention_threshold =&gt; &#39;7d&#39;)</pre><p><strong><em>Remove orphan files:</em></strong></p><pre>alter table my_iceberg_table execute remove_orphan_files(retention_threshold =&gt; &#39;7d&#39;)</pre><p><strong><em>Drop extended stats:</em></strong></p><pre>alter table my_iceberg_table execute drop_extended_stats</pre><p><strong><em>Analyze table:</em></strong></p><pre>analyze my_iceberg_table</pre><p>Para uso do operador, basta criar uma conexão com o seu ambiente de Trino escolhido e fazer a cópia do código abaixo para seguinte estrutura dentro seu airflow: <em>/plugins/custom_operator/</em></p><pre>from custom_operator.trino_iceberg_table_maintenance import TrinoIcebergTableMaintanance<br><br><br>with dag:<br>    hello_task = TrinoIcebergTableMaintanance(<br>    task_id=&quot;sample-task&quot;, <br>    table_name=&quot;my_iceberg_catalog.my_iceberg_schema.my_iceberg_table&quot;,<br>    conn_id=&quot;my_trino_connection&quot;<br>)</pre><p>Link para o repositório git:</p><p><a href="https://github.com/ShuffleMind/airflow">GitHub - ShuffleMind/airflow</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c442153001c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>