<?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 Nikita Nikumbh on Medium]]></title>
        <description><![CDATA[Stories by Nikita Nikumbh on Medium]]></description>
        <link>https://medium.com/@nikitanikumbh13?source=rss-f1f7a0b183e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h-WHXEAbZwFDJDnt7iU9cA.jpeg</url>
            <title>Stories by Nikita Nikumbh on Medium</title>
            <link>https://medium.com/@nikitanikumbh13?source=rss-f1f7a0b183e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 18:29:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikitanikumbh13/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[Terraform : From Clicking to Coding: How Terraform Changes the Way We Manage Cloud Infrastructure]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@nikitanikumbh13/terraform-from-clicking-to-coding-how-terraform-changes-the-way-we-manage-cloud-infrastructure-363054e6d268?source=rss-f1f7a0b183e8------2"><img src="https://cdn-images-1.medium.com/max/2400/1*8iWA6oIjeLbf7z8DvJYguw.png" width="2400"></a></p><p class="medium-feed-snippet">What is Terraform?</p><p class="medium-feed-link"><a href="https://medium.com/@nikitanikumbh13/terraform-from-clicking-to-coding-how-terraform-changes-the-way-we-manage-cloud-infrastructure-363054e6d268?source=rss-f1f7a0b183e8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nikitanikumbh13/terraform-from-clicking-to-coding-how-terraform-changes-the-way-we-manage-cloud-infrastructure-363054e6d268?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/363054e6d268</guid>
            <category><![CDATA[pen-with-paper]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[version-control]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 17 Sep 2026 14:33:44 GMT</pubDate>
            <atom:updated>2026-09-17T14:36:20.361Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Upgrading Amazon RDS MySQL 8.0 to 8.4 Using a Snapshot-Based Approach]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@nikitanikumbh13/upgrading-amazon-rds-mysql-8-0-to-8-4-using-a-snapshot-based-approach-0b2011047dfc?source=rss-f1f7a0b183e8------2"><img src="https://cdn-images-1.medium.com/max/600/1*wHyCY-8NUaUQ3MatjQXyuQ.png" width="600"></a></p><p class="medium-feed-snippet">Upgrading a production database is always something that needs to be approached carefully. Unlike a normal application deployment, a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@nikitanikumbh13/upgrading-amazon-rds-mysql-8-0-to-8-4-using-a-snapshot-based-approach-0b2011047dfc?source=rss-f1f7a0b183e8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nikitanikumbh13/upgrading-amazon-rds-mysql-8-0-to-8-4-using-a-snapshot-based-approach-0b2011047dfc?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b2011047dfc</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[mysql-8]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[aws-rds]]></category>
            <category><![CDATA[upgrades-and-migrations]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 18:14:58 GMT</pubDate>
            <atom:updated>2026-09-21T13:14:15.078Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Thought I Was Moving to Canada. I Didn’t Realize I Was Leaving a Part of Myself Behind]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@nikitanikumbh13/i-thought-i-was-moving-to-canada-i-didnt-realize-i-was-leaving-a-part-of-myself-behind-83d8d37fe3c7?source=rss-f1f7a0b183e8------2"><img src="https://cdn-images-1.medium.com/max/2048/1*QyMeCkay5TvdAEvx88uocg.jpeg" width="2048"></a></p><p class="medium-feed-snippet">I recently moved to Canada. I&#x2019;ve always been curious about life abroad, but leaving behind a settled life in my home country wasn&#x2019;t easy&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@nikitanikumbh13/i-thought-i-was-moving-to-canada-i-didnt-realize-i-was-leaving-a-part-of-myself-behind-83d8d37fe3c7?source=rss-f1f7a0b183e8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nikitanikumbh13/i-thought-i-was-moving-to-canada-i-didnt-realize-i-was-leaving-a-part-of-myself-behind-83d8d37fe3c7?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/83d8d37fe3c7</guid>
            <category><![CDATA[canada]]></category>
            <category><![CDATA[new-life]]></category>
            <category><![CDATA[moving-abroad]]></category>
            <category><![CDATA[pen-with-paper]]></category>
            <category><![CDATA[missing-home]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 15:16:32 GMT</pubDate>
            <atom:updated>2026-08-17T15:16:32.533Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Do We Need a Data Warehouse or Data Lake?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@nikitanikumbh13/why-do-we-need-a-data-warehouse-or-data-lake-7a12343e0cc0?source=rss-f1f7a0b183e8------2"><img src="https://cdn-images-1.medium.com/max/1200/1*VJoYU6N8F_xVcBe5TynAYA.jpeg" width="1200"></a></p><p class="medium-feed-snippet">Organizations today generate data everywhere &#x2014; from applications, databases, APIs, CRM systems, ERP platforms, spreadsheets, IoT devices&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@nikitanikumbh13/why-do-we-need-a-data-warehouse-or-data-lake-7a12343e0cc0?source=rss-f1f7a0b183e8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nikitanikumbh13/why-do-we-need-a-data-warehouse-or-data-lake-7a12343e0cc0?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a12343e0cc0</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-lakehouse]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 13 Aug 2026 19:00:57 GMT</pubDate>
            <atom:updated>2026-09-21T13:13:21.698Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Migrating from Amazon Aurora MySQL 5.7 to Amazon RDS MySQL 8]]></title>
            <link>https://python.plainenglish.io/a-practical-guide-to-migrating-from-amazon-aurora-mysql-5-7-to-amazon-rds-mysql-8-af1969b92917?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/af1969b92917</guid>
            <category><![CDATA[aws-rds]]></category>
            <category><![CDATA[aws-aurora]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[mysql-8]]></category>
            <category><![CDATA[upgrade]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 18:51:15 GMT</pubDate>
            <atom:updated>2026-07-24T17:34:51.808Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*O7AjMt22KZCh-qTds-XQUg.png" /></figure><h3>Introduction</h3><p>Upgrading a production database is never just about changing the database version. It involves compatibility assessment, infrastructure planning, application validation, performance testing, and risk management.</p><p>Recently, I worked through planning a migration from <strong>Amazon Aurora MySQL 5.7</strong> to <strong>Amazon RDS MySQL 8</strong>, where the database supports multiple applications including reporting platforms, ETL jobs, automation tools, and custom applications.</p><p>Rather than performing an in-place upgrade, the migration strategy uses a <strong>dump-and-restore approach</strong>, allowing complete control over the migration and reducing operational risk.</p><p>This article shares the migration approach, lessons learned, and best practices.</p><h3>Why Upgrade to MySQL 8?</h3><p>MySQL 8 introduces numerous improvements over MySQL 5.7, including:</p><ul><li>Improved optimizer</li><li>Better indexing</li><li>Common Table Expressions (CTEs)</li><li>Window Functions</li><li>Enhanced JSON support</li><li>Improved security</li><li>Better Performance Schema</li><li>Long-term support</li></ul><p>However, these improvements also introduce stricter SQL behavior that can break older applications if not handled carefully.</p><h3>Why Not Upgrade In Place?</h3><p>Although Aurora supports upgrade paths, we selected a <strong>dump-and-restore migration</strong> because it provides several advantages:</p><ul><li>Independent testing environment</li><li>Easy rollback</li><li>Full validation before cutover</li><li>Opportunity to redesign infrastructure</li><li>Ability to clean up technical debt before migration</li></ul><p>Migration Flow:</p><p>Aurora MySQL 5.7</p><p>↓</p><p>mysqldump</p><p>↓</p><p>Amazon RDS MySQL 8</p><p>↓</p><p>Application Validation</p><p>↓</p><p>Production Cutover</p><h3>Phase 1 — Environment Assessment</h3><p>Before touching the database, inventory the environment.</p><p>Typical checklist:</p><ul><li>Database size</li><li>Number of schemas</li><li>Storage engines</li><li>Stored Procedures</li><li>Functions</li><li>Triggers</li><li>Events</li><li>Views</li><li>Application dependencies</li><li>JDBC drivers</li><li>Backup strategy</li></ul><p>This helps identify migration risks early.</p><h3>Phase 2 — Compatibility Assessment</h3><p>One of the biggest mistakes is assuming MySQL 8 behaves exactly like MySQL 5.7.</p><p>Areas to review include:</p><h3>SQL Mode</h3><p>MySQL 8 enables stricter SQL validation.</p><p>Instead of immediately enabling every new rule, start with MySQL 5.7-compatible settings:</p><ul><li>STRICT_TRANS_TABLES</li><li>NO_ENGINE_SUBSTITUTION</li></ul><p>Delay enabling:</p><ul><li>ONLY_FULL_GROUP_BY</li><li>ERROR_FOR_DIVISION_BY_ZERO</li></ul><p>until the application has been fully validated.</p><h3>Reserved Keywords</h3><p>MySQL 8 introduces new reserved keywords.</p><p>Examples:</p><ul><li>RANK</li><li>WINDOW</li><li>SYSTEM</li><li>GROUP</li><li>OVER</li></ul><p>Existing objects using these names may require renaming or quoting.</p><h3>Zero Dates</h3><p>Many legacy databases still contain values such as:</p><ul><li>0000–00–00</li><li>2034–00–00</li></ul><p>These should be identified and corrected before migration.</p><h3>Storage Engines</h3><p>Ensure all tables use InnoDB.</p><p>MyISAM tables should be converted before migrating whenever practical.</p><h3>Phase 3 — Parameter Review</h3><p>Server parameters are often overlooked.</p><p>Review each variable and classify it as:</p><ul><li>Keep</li><li>Change</li><li>Remove</li><li>Aurora Only</li><li>Review if Needed</li></ul><p>Examples:</p><p>Keep:</p><ul><li>character_set_server</li><li>collation_server</li><li>binlog_format</li></ul><p>Remove:</p><ul><li>query_cache_size</li><li>query_cache_type</li><li>sync_frm</li><li>innodb_file_format</li></ul><p>Review:</p><ul><li>max_connections</li><li>max_allowed_packet</li><li>local_infile</li><li>tmp_table_size</li></ul><p>Aurora Only:</p><ul><li>aurora_*</li></ul><p>These parameters do not exist on Amazon RDS.</p><h3>Phase 4 — Build Amazon RDS</h3><p>Instead of restoring into an empty default instance, build RDS properly.</p><p>Recommended configuration:</p><ul><li>Private Subnets</li><li>Security Groups</li><li>Custom Parameter Group</li><li>Performance Insights</li><li>CloudWatch Logs</li><li>Automated Backups</li><li>KMS Encryption</li><li>Multi-AZ (Production)</li></ul><p>Treat infrastructure as part of the migration rather than an afterthought.</p><h3>Phase 5 — Restore the Database</h3><p>Export using:</p><ul><li>mysqldump</li><li>mysqlpump (optional)</li></ul><p>Restore into the new RDS instance.</p><p>After restoration, verify:</p><ul><li>Table count</li><li>Views</li><li>Procedures</li><li>Functions</li><li>Triggers</li><li>Events</li><li>Row counts</li></ul><h3>Phase 6 — Application Validation</h3><p>Database validation is only half the work.</p><p>Every dependent application should be tested.</p><p>Examples:</p><ul><li>Reporting tools</li><li>ETL jobs</li><li>Automation workflows</li><li>Python scripts</li><li>Scheduled jobs</li><li>APIs</li></ul><p>Run representative workloads and compare results with the source environment.</p><h3>Phase 7 — Enable MySQL 8 Features Gradually</h3><p>Avoid enabling all MySQL 8 defaults immediately.</p><p>A phased approach is safer.</p><p>Phase 1</p><p>Maintain MySQL 5.7 compatibility.</p><p>Phase 2</p><p>Enable:</p><ul><li>ERROR_FOR_DIVISION_BY_ZERO</li></ul><p>Resolve issues.</p><p>Phase 3</p><p>Enable:</p><ul><li>ONLY_FULL_GROUP_BY</li></ul><p>Resolve SQL compatibility issues.</p><p>Phase 4</p><p>Modernize:</p><ul><li>utf8mb4</li><li>Modern authentication</li><li>Updated collations</li></ul><p>This incremental strategy minimizes production risk.</p><h3>Infrastructure as Code</h3><p>Rather than manually creating Amazon RDS through the AWS Console, consider using <strong>Terraform</strong>.</p><p>Terraform allows you to define infrastructure as code, including:</p><ul><li>Amazon RDS</li><li>Security Groups</li><li>Parameter Groups</li><li>Option Groups</li><li>Monitoring</li><li>CloudWatch</li><li>Secrets Manager</li></ul><p>Benefits include:</p><ul><li>Version control</li><li>Repeatable deployments</li><li>Consistent DEV/UAT/PROD environments</li><li>Easier disaster recovery</li><li>Automated infrastructure provisioning</li></ul><h3>Monitoring After Migration</h3><p>After go-live, monitor:</p><ul><li>CPU utilization</li><li>Memory usage</li><li>Database connections</li><li>Slow queries</li><li>IOPS</li><li>Storage throughput</li><li>Replication (if applicable)</li></ul><p>Use CloudWatch and Performance Insights to identify tuning opportunities.</p><h3>Lessons Learned</h3><p>A successful MySQL upgrade is far more than changing the database version.</p><p>The most successful projects invest time in:</p><ul><li>Compatibility analysis</li><li>Parameter review</li><li>Infrastructure planning</li><li>Application testing</li><li>Incremental adoption of new features</li></ul><p>By following a phased migration strategy, organizations can significantly reduce risk while taking advantage of the improvements available in MySQL 8.</p><h3>Conclusion</h3><p>Migrating from Amazon Aurora MySQL 5.7 to Amazon RDS MySQL 8 is an excellent opportunity to modernize both your database and your operational practices.</p><p>Rather than treating the migration as a one-time upgrade, use it to:</p><ul><li>Improve database governance</li><li>Automate infrastructure with Terraform</li><li>Standardize environments</li><li>Review legacy SQL</li><li>Implement modern monitoring</li><li>Prepare for future cloud-native deployments</li></ul><p>A well-planned migration not only delivers a newer database engine but also creates a more maintainable, scalable, and resilient platform for the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af1969b92917" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/a-practical-guide-to-migrating-from-amazon-aurora-mysql-5-7-to-amazon-rds-mysql-8-af1969b92917">A Practical Guide to Migrating from Amazon Aurora MySQL 5.7 to Amazon RDS MySQL 8</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Lost Queen from Another Time]]></title>
            <link>https://medium.com/@nikitanikumbh13/the-lost-queen-from-another-time-4cd0767ab314?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cd0767ab314</guid>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 00:21:57 GMT</pubDate>
            <atom:updated>2026-03-23T00:21:57.741Z</atom:updated>
            <content:encoded><![CDATA[<p>⭐ <strong>The First Shift</strong> ⭐</p><p>Myra didn’t realize the moment her life was about to change.</p><p>She was just sitting in her backyard like she did on most quiet afternoons — coffee in one hand, a book in the other, and soft music playing somewhere in the background.</p><p>Her house sat near snowy mountains, with a dense forest stretching behind it. It was peaceful there. The kind of place where time slowed down and getting lost in a book felt easy.</p><p>And Myra loved that feeling.</p><p>She had always been the kind of reader who didn’t just read stories — she stepped into them. The characters felt real to her, the places felt alive, and sometimes she would sit for hours imagining what it would be like to live in those worlds.</p><p>That afternoon, the book in her hands was about an ancient kingdom from the era of kings and queens.</p><p>The story was fascinating. Royal courts, hidden secrets, powerful rulers — every page made her more curious.</p><p>She took a sip of her coffee and turned another page.</p><p>That’s when she saw it.</p><p>A portrait of the queen.</p><p>Myra paused.</p><p>Something about the queen’s face felt strangely familiar. She leaned a little closer to the page, studying the details.</p><p>The eyes.</p><p>The expression.</p><p>It felt as if she had seen that face somewhere before.</p><p>“That’s weird…” she murmured.</p><p>Without really thinking about it, she gently touched the portrait with her fingers.</p><p>And suddenly, something strange began to happen.</p><p>The music faded.</p><p>The cold mountain air shifted.</p><p>The backyard, the chair, the coffee table — everything around her started to blur, as if the world itself was being erased.</p><p>Myra blinked, confused.</p><p>When she opened her eyes again, she was no longer sitting in her backyard.</p><p>Tall stone walls surrounded her. Torches flickered along the hallways. The air smelled of old wood and burning candles.</p><p>Her heart began to race.</p><p>Slowly, she looked down at herself.</p><p>The comfortable clothes she had been wearing were gone.</p><p>Instead, she was dressed in a magnificent royal gown.</p><p>Myra slowly turned toward a large mirror standing nearby.</p><p>And when she saw the reflection staring back at her…</p><p>Her breath caught.</p><p>The woman in the mirror looked exactly like the queen from the portrait.</p><p>Somehow, Myra had traveled back in time.</p><p>And even more strangely…</p><p>She wasn’t just in the past.</p><p>She <strong>was the queen</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cd0767ab314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How I Fixed the “Invalid Callable Syntax” Error in GoAnywhere After Moving MySQL to AWS]]></title>
            <link>https://python.plainenglish.io/how-i-fixed-the-invalid-callable-syntax-error-in-goanywhere-after-moving-mysql-to-aws-79fb4b8aaa62?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/79fb4b8aaa62</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[jdbc-dr]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[stored-procedure]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 21:17:05 GMT</pubDate>
            <atom:updated>2025-11-15T06:09:26.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*0cWFU0lfAgW95JHx-SIqRw.png" /></figure><p>When we migrated our MySQL database to an AWS EC2 instance, a process that had been working for years suddenly broke.<br> Our GoAnywhere project, which executed a stored procedure every month, started throwing this error:</p><h4><strong>invalid callable syntax. must be like {? = call &lt;procedure/function name&gt;[(?,?, …)]}</strong></h4><p><strong>⚙️ Background</strong></p><p>In our setup, GoAnywhere MFT connected to a MySQL database.<br>Before migration, the database was hosted on-prem, and everything ran smoothly with a simple SQL Task:</p><pre>CALL database_name.stored_procedure_name(<br>CAST(DATE_FORMAT(CURDATE() - INTERVAL 1 MONTH, &#39;%Y-%m-01 00:00:00&#39;) AS DATETIME),<br>CAST(DATE_FORMAT(LAST_DAY(CURDATE() - INTERVAL 1 MONTH), &#39;%Y-%m-%d 23:59:59&#39;) AS DATETIME)<br>);</pre><p>After moving MySQL to AWS, GoAnywhere began rejecting this syntax, even though it still worked perfectly in MySQL Workbench.<br>That’s because GoAnywhere’s JDBC execution behavior changed when connecting remotely using the <strong>MariaDB JDBC driver (org.mariadb.jdbc.Driver)</strong>.</p><p><strong>🧩 Understanding the Problem</strong></p><p>GoAnywhere has two types of SQL execution tasks:</p><pre>Task Type :  SQL Task<br>Description : Uses JDBC CallableStatement - expects strict {CALL …} syntax<br>Syntax Style : {CALL procedure(?, ?)}</pre><pre>Task Type : SQL Script Task<br>Description : Sends SQL directly to the database<br>Syntax Style : Native MySQL syntax (CALL …;)</pre><p>The <strong>MariaDB JDBC driver</strong> bundled with GoAnywhere is strict about callable statements.<br>It doesn’t allow expressions or MySQL functions inside {CALL …} — only simple parameter placeholders like ?.</p><p>So even though our procedure call was valid SQL, the driver rejected it <strong>before</strong> sending it to MySQL.</p><p><strong>✅ The Solution: Use SQL Script Task</strong></p><p>The simplest and most reliable solution was to <strong>switch from a “SQL Task” to a “SQL Script Task.”</strong></p><p><strong>🔹 Step 1: Create a SQL Script Task</strong></p><ol><li>In GoAnywhere, open your project.</li><li>Click <strong>Add Task → SQL Script</strong>.</li><li>Select your existing database resource (which still uses org.mariadb.jdbc.Driver).</li></ol><p><strong>🔹 Step 2: Add your SQL Script</strong></p><p>Paste this SQL code:</p><pre>SET @start_date = DATE_FORMAT(CURDATE() - INTERVAL 1 MONTH, &#39;%Y-%m-01 00:00:00&#39;);<br>SET @end_date = DATE_FORMAT(LAST_DAY(CURDATE() - INTERVAL 1 MONTH), &#39;%Y-%m-%d 23:59:59&#39;);<br>CALL database_name.stored_procedure_name(@start_date, @end_date);</pre><p><strong>🔹 Step 3: Enable Multiple Statements</strong></p><p>Edit your <strong>Database Resource</strong> and make sure your JDBC URL includes:</p><pre>?allowMultiQueries=true<br>Example:<br>jdbc:mariadb://your-ec2-host:3306/your_database?allowMultiQueries=true</pre><p><strong>🔹 Step 4: Run the Project</strong></p><p>The procedure runs normally again — no more invalid callable syntax errors.</p><p><strong>🧠 Why It Works</strong></p><ul><li><strong>SQL Script Task</strong> bypasses JDBC CallableStatement parsing and sends SQL straight to MySQL.</li><li>The <strong>allowMultiQueries=true</strong> flag lets multiple statements (SET, CALL, etc.) execute together.</li><li>This approach works seamlessly with the MariaDB driver — no need to install a new one.</li></ul><p><strong>⚙️ Optional: Switching to the MySQL JDBC Driver</strong></p><p>If you want full MySQL compatibility, you can install the official MySQL Connector/J:</p><ol><li>Download from <a href="https://dev.mysql.com/downloads/connector/j/">MySQL Connector/J Downloads</a>.</li><li>Copy the JAR (e.g. mysql-connector-j-8.0.33.jar) into C:\Program Files\GoAnywhere\lib\ext\</li><li>Restart the <strong>GoAnywhere MFT Service</strong>.</li><li>Create a new resource using com.mysql.cj.jdbc.Driver and test the connection.</li></ol><p>This also resolves the error — but the <strong>SQL Script Task</strong> solution is quicker and requires no system-level changes.</p><p><strong>✨ Conclusion</strong></p><p>If you’re migrating a MySQL database to AWS (EC2 or RDS) and suddenly hit the “invalid callable syntax”<br> error in GoAnywhere — don’t panic.</p><p>You don’t need to rebuild your stored procedure or install new drivers.<br> Just switch your <strong>SQL Task</strong> to a <strong>SQL Script Task</strong>, add allowMultiQueries=true, and run your SQL natively.</p><p>It’s a simple, clean, and effective fix that keeps everything running exactly as before your migration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79fb4b8aaa62" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/how-i-fixed-the-invalid-callable-syntax-error-in-goanywhere-after-moving-mysql-to-aws-79fb4b8aaa62">🚀 How I Fixed the “Invalid Callable Syntax” Error in GoAnywhere After Moving MySQL to AWS</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All You Need to Know About Date and Time Data Types and Functions in SQL]]></title>
            <link>https://python.plainenglish.io/all-you-need-to-know-about-date-and-time-data-types-and-functions-in-sql-22678fc3b079?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/22678fc3b079</guid>
            <category><![CDATA[date-and-time]]></category>
            <category><![CDATA[time-functions]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[date-function]]></category>
            <category><![CDATA[datatypes-in-sql]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 20:39:05 GMT</pubDate>
            <atom:updated>2025-03-10T00:55:52.439Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL offers several <strong>date and time data types</strong> to store date, time, and timestamp information. These data types can vary slightly across different SQL databases like <strong>MySQL</strong>, <strong>PostgreSQL</strong>, <strong>SQL Server</strong>, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ot0HM_2hzJfF0M_jpLZaOQ.jpeg" /></figure><p>Here’s a comprehensive list of <strong>date and time-related data types</strong> that are supported across various SQL databases:</p><h3><strong>1. Date and Time Data Types in SQL</strong></h3><p><strong>1.1 DATE</strong></p><ul><li><strong>Definition</strong>: Stores only the <strong>date</strong> (year, month, day).</li><li><strong>Format</strong>: YYYY-MM-DD</li><li><strong>Usage</strong>: When you only need to store the date without the time.</li><li><strong>Example</strong>: ‘2025–03–02’</li></ul><p><strong>1.2 TIME</strong></p><ul><li><strong>Definition</strong>: Stores only the <strong>time</strong> (hour, minute, second).</li><li><strong>Format</strong>: HH:MM:SS</li><li><strong>Usage</strong>: When you only need to store the time (without the date).</li><li><strong>Example</strong>: ‘14:30:00’</li></ul><p><strong>1.3 DATETIME</strong></p><ul><li><strong>Definition</strong>: Stores <strong>both date and time</strong>.</li><li><strong>Format</strong>: YYYY-MM-DD HH:MM:SS</li><li><strong>Usage</strong>: When you need both the date and time (without time zone information).</li><li><strong>Example</strong>: ‘2025–03–02 14:30:00’</li><li><strong>Notes</strong>: In some databases like <strong>MySQL</strong>, DATETIME is used, but it does not store time zone information.</li></ul><p><strong>1.4 TIMESTAMP</strong></p><ul><li><strong>Definition</strong>: Stores <strong>both date and time</strong> and usually includes <strong>time zone</strong> information.</li><li><strong>Format</strong>: YYYY-MM-DD HH:MM:SS (can include fractional seconds in some systems).</li><li><strong>Usage</strong>: Used for tracking events and logging, especially when working with time zones.</li><li><strong>Example</strong>: ‘2025–03–02 14:30:00’ or ‘2025–03–02 14:30:00.123’</li><li><strong>Notes</strong>: TIMESTAMP can often be used as a substitute for DATETIME in databases like <strong>MySQL</strong>, <strong>PostgreSQL</strong>, and <strong>SQL Server</strong>.</li></ul><p><strong>1.5 YEAR</strong></p><ul><li><strong>Definition</strong>: Stores only the <strong>year</strong> (with optional precision).</li><li><strong>Format</strong>: YYYY</li><li><strong>Usage</strong>: When only the year is needed.</li><li><strong>Example</strong>: ‘2025’</li></ul><h3><strong>MySQL-Specific Date and Time Types</strong></h3><p><strong>5.1 DATE</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>date</strong> only.</li><li><strong>Usage</strong>: Same as in other databases.</li></ul><p><strong>5.2 TIME</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>time</strong> only.</li><li><strong>Usage</strong>: Same as in other databases.</li></ul><p><strong>5.3 DATETIME</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>both date and time</strong>.</li><li><strong>Usage</strong>: Used for storing events with date and time.</li></ul><p><strong>5.4 TIMESTAMP</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>both date and time</strong> with <strong>time zone</strong> handling.</li><li><strong>Usage</strong>: Common for logging and tracking events.</li><li><strong>Example</strong>: ‘2025–03–02 14:30:00’</li></ul><p><strong>5.5 YEAR</strong></p><ul><li><strong>Definition</strong>: Stores <strong>year</strong> only.</li></ul><p><strong>Usage</strong>: When you only need the year (e.g., for birthdates, fiscal years).</p><h3><strong>PostgreSQL-Specific Date and Time Types</strong></h3><p><strong>4.1 DATE</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>date</strong> only.</li><li><strong>Usage</strong>: Same as in MySQL or SQL Server.</li></ul><p><strong>4.2 TIME</strong></p><ul><li><strong>Definition</strong>: Same as above, stores <strong>time</strong> only.</li><li><strong>Usage</strong>: Same as in MySQL or SQL Server.</li></ul><p><strong>4.3 TIMESTAMP</strong></p><ul><li><strong>Definition</strong>: Stores <strong>both date and time</strong> without time zone.</li><li><strong>Usage</strong>: Same as in MySQL and SQL Server.</li></ul><p><strong>4.4 TIMESTAMP WITH TIME ZONE</strong></p><ul><li><strong>Definition</strong>: Stores <strong>both date and time</strong> with <strong>time zone</strong> information.</li><li><strong>Usage</strong>: When working with time zones, often used for event logging.</li><li><strong>Example</strong>: ‘2025–03–02 14:30:00+00’</li></ul><p><strong>4.5 TIMESTAMPTZ (PostgreSQL abbreviation for TIMESTAMP WITH TIME ZONE)</strong></p><ul><li><strong>Definition</strong>: Same as TIMESTAMP WITH TIME ZONE.</li><li><strong>Usage</strong>: Common abbreviation in PostgreSQL.</li></ul><p><strong>4.6 INTERVAL</strong></p><ul><li><strong>Definition</strong>: Used for <strong>time intervals</strong> (durations), can include years, months, days, hours, minutes, and seconds.</li><li><strong>Usage</strong>: Used for date arithmetic or storing durations.</li><li><strong>Example</strong>: INTERVAL ‘1 day 5 hours’</li></ul><h3>Date functions<strong> across different SQL dialects, including examples</strong></h3><h3>1. NOW() / CURRENT_TIMESTAMP</h3><p>Returns the <strong>current date and time</strong>.</p><pre>SELECT NOW();  -- MySQL, PostgreSQL, SQL Server</pre><pre>SELECT CURRENT_TIMESTAMP;  -- PostgreSQL, SQL Server</pre><h3>2. CURDATE() / CURRENT_DATE</h3><p>Returns the <strong>current date</strong> (without time).</p><pre>SELECT CURDATE();  -- MySQL</pre><pre>SELECT CURRENT_DATE;  -- PostgreSQL, SQL Server</pre><h3>3. DATE()</h3><p>Extracts the <strong>date part</strong> from a DATETIME or TIMESTAMP column, removing the time.</p><pre>SELECT DATE(order_date) FROM orders;  -- MySQL, PostgreSQL</pre><h3>4. YEAR(), MONTH(), DAY()</h3><p>Extracts <strong>year</strong>, <strong>month</strong>, or <strong>day</strong> from a date or timestamp.</p><pre>SELECT YEAR(order_date), MONTH(order_date), DAY(order_date) <br>FROM orders;  -- MySQL, PostgreSQL</pre><h3>5. EXTRACT()</h3><p>Extracts a specific part of a date or timestamp (e.g., year, month, day, etc.).</p><pre>SELECT EXTRACT(YEAR FROM order_date) AS year,<br>EXTRACT(MONTH FROM order_date) AS month,<br>EXTRACT(DAY FROM order_date) AS day<br>FROM orders;  -- PostgreSQL, MySQL</pre><h3>6. DATE_ADD() / DATE_SUB()</h3><p>Adds or subtracts a specified <strong>interval</strong> to/from a date.</p><pre>SELECT DATE_ADD(order_date, INTERVAL 1 MONTH) FROM orders;  -- MySQL</pre><pre>SELECT DATE_SUB(order_date, INTERVAL 1 DAY) FROM orders;  -- MySQL</pre><p>In <strong>PostgreSQL</strong>, you would use + INTERVAL:</p><pre>SELECT order_date + INTERVAL &#39;1 month&#39; FROM orders;  -- PostgreSQL</pre><pre>SELECT order_date - INTERVAL &#39;1 day&#39; FROM orders;  -- PostgreSQL</pre><h3>7. DATEDIFF()</h3><p>Returns the <strong>difference</strong> between two dates, in days.</p><pre>SELECT DATEDIFF(&#39;2025-02-01&#39;, &#39;2025-01-01&#39;);  -- MySQL, SQL Server</pre><pre>SELECT DATE &#39;2025-02-01&#39; - DATE &#39;2025-01-01&#39;;  -- PostgreSQL</pre><h3>8. DATE_TRUNC()</h3><p>Truncates a date to a specified precision (e.g., <strong>month</strong>, <strong>year</strong>).</p><pre>SELECT DATE_TRUNC(&#39;month&#39;, order_date) FROM orders;  -- PostgreSQL</pre><p>This will return the first date of the <strong>month</strong> for each order_date.</p><h3>9. STRFTIME() (SQLite)</h3><p>Formats a date using a specific <strong>format string</strong>.</p><pre>SELECT STRFTIME(&#39;%Y-%m-%d&#39;, order_date) FROM orders;  -- SQLite</pre><h3>10. TIMESTAMPDIFF()</h3><p>Returns the <strong>difference</strong> between two date/timestamp values, in specified units (like <strong>days</strong>, <strong>months</strong>, <strong>years</strong>, etc.).</p><pre>SELECT TIMESTAMPDIFF(DAY, &#39;2025-01-01&#39;, &#39;2025-02-01&#39;);  -- MySQL</pre><h3>11. TO_DATE() / TO_TIMESTAMP()</h3><p>Converts a string to a <strong>date</strong> or <strong>timestamp</strong>.</p><pre>SELECT TO_DATE(&#39;2025-01-01&#39;, &#39;YYYY-MM-DD&#39;);  -- PostgreSQL</pre><pre>SELECT TO_TIMESTAMP(&#39;2025-01-01 12:00:00&#39;, &#39;YYYY-MM-DD HH24:MI:SS&#39;);  -- PostgreSQL</pre><h3>15. LAST_DAY()</h3><p>Returns the <strong>last day</strong> of the month for a given date.</p><pre>SELECT LAST_DAY(order_date) FROM orders;  -- MySQL, SQL Server</pre><h3>16. DATE_FORMAT()</h3><p><strong>Display a date or time value in a specific format</strong>. It converts a date into a readable string using format specifiers (like %Y, %m, %d, etc.)</p><pre>--syntax<br>DATE_FORMAT(date, format)</pre><ul><li><strong>date</strong> – The date or datetime value you want to format.</li><li><strong>format</strong> – The pattern you want for the output.</li></ul><h4>Common Format Specifiers:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*eoWLLlhMMPBNCmdDqc_7Yg.png" /></figure><h3>Example:</h3><pre>SELECT DATE_FORMAT(NOW(), &#39;%Y-%m-%d %H:%i:%s&#39;) AS formatted_date;<br><br>Output:<br>2025-03-06 14:45:30</pre><pre>SELECT DATE_FORMAT(&#39;2025-03-06&#39;, &#39;%M %d, %Y&#39;) AS formatted_date;<br><br>Output:<br>March 06, 2025</pre><p>The <strong>INTERVAL function</strong> in SQL is used to perform <strong>date arithmetic</strong> (add or subtract time) by defining a specific time period. The syntax and behavior may vary slightly between different SQL databases, but the general concept remains the same.</p><p>Here’s a breakdown of how <strong>INTERVAL</strong> works and how it can be used in different SQL dialects:</p><p><strong>1. Adding/Subtracting Dates with INTERVAL</strong></p><p><strong>MySQL:</strong></p><p>In <strong>MySQL</strong>, the INTERVAL keyword is used with <strong>DATE_ADD()</strong> or <strong>DATE_SUB()</strong> to add or subtract time.</p><pre>--Syntax for Adding<br>SELECT DATE_ADD(&#39;2025–01–01&#39;, INTERVAL 1 MONTH); - Add 1 month</pre><pre>--Syntax for Subtracting<br>SELECT DATE_SUB(&#39;2025–01–01&#39;, INTERVAL 1 MONTH); - Subtract 1 month</pre><pre>--Add/Subtract other units (e.g., DAY, YEAR):<br>SELECT DATE_ADD(&#39;2025–01–01&#39;, INTERVAL 2 DAY); - Add 2 days<br>SELECT DATE_SUB(&#39;2025–01–01&#39;, INTERVAL 3 YEAR); - Subtract 3 years</pre><p><strong>PostgreSQL:</strong></p><p>In <strong>PostgreSQL</strong>, INTERVAL is used directly in date arithmetic, either by adding it to a date or using the +/- operators.</p><pre>--Syntax for Adding:<br>SELECT &#39;2025–01–01&#39;::DATE + INTERVAL &#39;1 month&#39;; - Add 1 month</pre><pre>Syntax for Subtracting:<br>SELECT &#39;2025–01–01&#39;::DATE - INTERVAL &#39;1 month&#39;; - Subtract 1 month</pre><pre>--Add/Subtract other units:<br>SELECT &#39;2025–01–01&#39;::DATE + INTERVAL &#39;2 days&#39;; - Add 2 days<br>SELECT &#39;2025–01–01&#39;::DATE - INTERVAL &#39;3 years&#39;; - Subtract 3 years</pre><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://differ.blog/inplainenglish"><strong>Differ</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22678fc3b079" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/all-you-need-to-know-about-date-and-time-data-types-and-functions-in-sql-22678fc3b079">All You Need to Know About Date and Time Data Types and Functions in SQL</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to handle data transfer between PySpark and external systems]]></title>
            <link>https://python.plainenglish.io/how-to-handle-data-transfer-between-pyspark-and-external-systems-e077049f42ba?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e077049f42ba</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[jdbc]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[pyspark]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 20:11:37 GMT</pubDate>
            <atom:updated>2025-02-10T04:48:50.402Z</atom:updated>
            <content:encoded><![CDATA[<p>Processing data using PySpark involves integrating with various external systems such as relational databases, Snowflake, cloud storage, and streaming platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9-bM83hLkbRpWg4HLogNw.jpeg" /></figure><p>PySpark can be hosted on various platforms, each suited for different use cases :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*03n_LtEQbFt_r2h17NZIZw.png" /></figure><p>If <strong>PySpark is running on Databricks</strong>, here’s how you can transfer data between PySpark and <strong>various external systems</strong> like <strong>Snowflake, databases, cloud storage (AWS S3, GCS), and streaming platforms (Kafka)</strong>.</p><h3>Setting Up PySpark on Databricks</h3><p>Databricks provides a managed <strong>Spark environment</strong>, and you can configure <strong>clusters</strong> with the required libraries.<br>To connect to external systems, install:</p><ul><li><strong>Snowflake Connector:</strong> net.snowflake:spark-snowflake_2.12</li><li><strong>JDBC Drivers:</strong> com.databricks:spark-xml_2.12</li><li><strong>AWS/GCS Connectors:</strong> org.apache.hadoop:hadoop-aws</li></ul><h3>1. Data Transfer Between PySpark (Databricks) and Snowflake</h3><h3>Install Snowflake Connector in Databricks</h3><p>In <strong>Databricks Clusters</strong>, install:</p><pre>net.snowflake:spark-snowflake_2.12<br>net.snowflake:snowflake-jdbc</pre><p>Read Data from Snowflake into PySpark</p><pre>sfOptions = {<br>    &quot;sfURL&quot;: &quot;https://&lt;your_snowflake_account&gt;.snowflakecomputing.com&quot;,<br>    &quot;sfDatabase&quot;: &quot;MY_DB&quot;,<br>    &quot;sfSchema&quot;: &quot;PUBLIC&quot;,<br>    &quot;sfWarehouse&quot;: &quot;COMPUTE_WH&quot;,<br>    &quot;sfUser&quot;: &quot;my_user&quot;,<br>    &quot;sfPassword&quot;: &quot;my_password&quot;<br>}<br><br>df = spark.read \<br>    .format(&quot;snowflake&quot;) \<br>    .options(**sfOptions) \<br>    .option(&quot;dbtable&quot;, &quot;MY_TABLE&quot;) \<br>    .load()<br><br>display(df)</pre><p>Write Data from PySpark to Snowflake</p><pre>df.write \<br>    .format(&quot;snowflake&quot;) \<br>    .options(**sfOptions) \<br>    .option(&quot;dbtable&quot;, &quot;MY_TARGET_TABLE&quot;) \<br>    .mode(&quot;append&quot;) \<br>    .save()</pre><h3>2. Data Transfer Between PySpark (Databricks) and AWS S3</h3><h3>Configure Databricks to Read from S3</h3><p>Go to <strong>Databricks Cluster → AWS IAM Roles</strong> and attach an IAM role with <strong>S3 permissions</strong>.<br>Alternatively, provide AWS credentials:</p><pre>spark.conf.set(&quot;fs.s3a.access.key&quot;, &quot;your-access-key&quot;)<br>spark.conf.set(&quot;fs.s3a.secret.key&quot;, &quot;your-secret-key&quot;)<br>spark.conf.set(&quot;fs.s3a.endpoint&quot;, &quot;s3.amazonaws.com&quot;)</pre><p>Read Data from S3 into PySpark</p><pre>df = spark.read.parquet(&quot;s3://my-bucket/data.parquet&quot;)<br>display(df)</pre><p>Write Data from PySpark to S3</p><pre>df.write.mode(&quot;overwrite&quot;).parquet(&quot;s3://my-bucket/output/&quot;)</pre><h3>3. Data Transfer Between PySpark (Databricks) and Google Cloud Storage (GCS)</h3><h3>Configure Databricks to Access GCS</h3><p>First, <strong>generate a GCS service account key</strong> and upload it to Databricks.<br>Then, set up credentials:</p><pre>spark.conf.set(&quot;fs.gs.auth.service.account.enable&quot;, &quot;true&quot;)<br>spark.conf.set(&quot;google.cloud.auth.service.account.json.keyfile&quot;, &quot;/dbfs/path-to-key.json&quot;)</pre><p>Read Data from GCS into PySpark</p><pre>df = spark.read.parquet(&quot;gs://my-bucket/data.parquet&quot;)<br>display(df)</pre><p>Write Data from PySpark to GCS</p><pre>df.write.mode(&quot;overwrite&quot;).parquet(&quot;gs://my-bucket/output/&quot;)</pre><h3>4. Data Transfer Between PySpark (Databricks) and Relational Databases (MySQL, PostgreSQL)</h3><h3>Install JDBC Driver in Databricks</h3><p>Upload the <strong>MySQL JDBC driver</strong> (mysql-connector-java.jar) to <strong>Databricks Cluster → Libraries</strong>.</p><p>Read Data from MySQL into PySpark</p><pre>df = spark.read \<br>    .format(&quot;jdbc&quot;) \<br>    .option(&quot;url&quot;, &quot;jdbc:mysql://your-host:3306/my_database&quot;) \<br>    .option(&quot;dbtable&quot;, &quot;my_table&quot;) \<br>    .option(&quot;user&quot;, &quot;my_user&quot;) \<br>    .option(&quot;password&quot;, &quot;my_password&quot;) \<br>    .load()<br>display(df)</pre><p>Write Data from PySpark to MySQL</p><pre>df.write \<br>    .format(&quot;jdbc&quot;) \<br>    .option(&quot;url&quot;, &quot;jdbc:mysql://your-host:3306/my_database&quot;) \<br>    .option(&quot;dbtable&quot;, &quot;my_target_table&quot;) \<br>    .option(&quot;user&quot;, &quot;my_user&quot;) \<br>    .option(&quot;password&quot;, &quot;my_password&quot;) \<br>    .mode(&quot;append&quot;) \<br>    .save()</pre><h3>5. Data Transfer Between PySpark (Databricks) and Kafka (Streaming)</h3><p>Read Streaming Data from Kafka</p><pre>df = spark.readStream \<br>    .format(&quot;kafka&quot;) \<br>    .option(&quot;kafka.bootstrap.servers&quot;, &quot;broker:9092&quot;) \<br>    .option(&quot;subscribe&quot;, &quot;my_topic&quot;) \<br>    .load()<br><br>df = df.selectExpr(&quot;CAST(key AS STRING)&quot;, &quot;CAST(value AS STRING)&quot;)<br>display(df)</pre><p>Write Streaming Data to Kafka</p><pre>df.writeStream \<br>    .format(&quot;kafka&quot;) \<br>    .option(&quot;kafka.bootstrap.servers&quot;, &quot;broker:9092&quot;) \<br>    .option(&quot;topic&quot;, &quot;output_topic&quot;) \<br>    .start()</pre><h3>6. Data Transfer Between PySpark (Databricks) and HDFS</h3><p>Read Data from HDFS into PySpark</p><pre>df = spark.read.parquet(&quot;hdfs://namenode:9000/data/input.parquet&quot;)<br>display(df)</pre><p>Write Data from PySpark to HDFS</p><pre>df.write.mode(&quot;overwrite&quot;).parquet(&quot;hdfs://namenode:9000/data/output/&quot;)</pre><p><strong>Optimizations for PySpark on Databricks</strong></p><ol><li>Partitioning for Performance</li></ol><pre>df.repartition(10).write.parquet(&quot;s3://my-bucket/output/&quot;)</pre><p>2. Using Delta Lake for Faster Reads/Writes</p><pre>df.write.format(&quot;delta&quot;).save(&quot;/mnt/delta/table/&quot;)</pre><p>3. Using Auto-Scaling Clusters for Cost Efficiency</p><p>Enable <strong>Databricks Autoscaling</strong> in <strong>Cluster Settings</strong>.</p><h4><strong>Summary Table</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*E0xwcUjru-Cps1jhfWMxgQ.png" /></figure><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e077049f42ba" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/how-to-handle-data-transfer-between-pyspark-and-external-systems-e077049f42ba">How to handle data transfer between PySpark and external systems</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing CSV, Avro, SAS, and Parquet: Pros, Cons, and Use Cases in Data Engineering]]></title>
            <link>https://python.plainenglish.io/comparing-csv-avro-sas-and-parquet-pros-cons-and-use-cases-in-data-engineering-f95b948eb76d?source=rss-f1f7a0b183e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f95b948eb76d</guid>
            <category><![CDATA[avro]]></category>
            <category><![CDATA[csv]]></category>
            <category><![CDATA[parquet]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[file-format]]></category>
            <dc:creator><![CDATA[Nikita Nikumbh]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 20:34:17 GMT</pubDate>
            <atom:updated>2025-02-10T04:47:49.305Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s a breakdown of the pros and cons of working with <strong>CSV</strong>, <strong>Avro</strong>, <strong>SAS</strong>, and <strong>Parquet</strong> in a data engineering project, particularly in contexts like Snowflake, S3, or other big data solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Yjdsj92sFFdbN-itU0aXqQ.jpeg" /></figure><h3>1. CSV (Comma-Separated Values)</h3><h4>Pros:</h4><ul><li><strong>Human-readable</strong>: Easy to read and edit with text editors or spreadsheet tools like Excel.</li><li><strong>Simple structure</strong>: Minimal overhead, making it straightforward for small datasets or when simplicity is key.</li><li><strong>Widely supported</strong>: Compatible with most data tools, programming languages, and databases.</li></ul><h4>Cons:</h4><ul><li><strong>Lacks schema</strong>: No embedded schema means data types and structure must be inferred or defined manually.</li><li><strong>Not optimized for big data</strong>: No compression or indexing, which results in larger file sizes and slower performance for large datasets.</li><li><strong>Error-prone</strong>: Susceptible to issues with delimiters, special characters, or inconsistent formatting.</li></ul><h4>Example:</h4><p>A file containing sales data.</p><pre>#csv<br>Date,Product,Price,Quantity<br>2025-01-20,Widget A,25.00,10<br>2025-01-21,Widget B,15.00,20<br>2025-01-22,Widget C,30.00,5</pre><h4>Use Case:</h4><ul><li>Importing/exporting small datasets for sharing with non-technical teams.</li><li>Initial data ingestion from external sources (e.g., FTP, SaaS exports).</li><li><strong>CSV</strong> for initial ingestion from external systems or quick debugging.</li></ul><h3>2. Avro</h3><h4>Pros:</h4><ul><li><strong>Schema-based</strong>: Stores the schema along with the data, making it self-describing and ideal for structured data processing.</li><li><strong>Compact and fast</strong>: Binary format with built-in compression, which reduces file size and improves I/O efficiency.</li><li><strong>Support for schema evolution</strong>: Changes in schema (e.g., adding a new field) are backward-compatible.</li><li><strong>Well-integrated</strong>: Works seamlessly with distributed systems like Hadoop, Spark, and Kafka.</li></ul><h4>Cons:</h4><ul><li><strong>Not human-readable</strong>: Binary format means the data is not directly viewable without a decoder.</li><li><strong>Limited tool support</strong>: While popular in big data ecosystems, Avro isn’t as widely supported as CSV or JSON in traditional tools.</li></ul><h4>Example:</h4><p>Avro requires two components: <strong>schema</strong> and <strong>data</strong>.</p><p><strong>Schema (JSON format):</strong></p><pre>{<br>  &quot;type&quot;: &quot;record&quot;,<br>  &quot;name&quot;: &quot;SalesData&quot;,<br>  &quot;fields&quot;: [<br>    {&quot;name&quot;: &quot;Date&quot;, &quot;type&quot;: &quot;string&quot;},<br>    {&quot;name&quot;: &quot;Product&quot;, &quot;type&quot;: &quot;string&quot;},<br>    {&quot;name&quot;: &quot;Price&quot;, &quot;type&quot;: &quot;float&quot;},<br>    {&quot;name&quot;: &quot;Quantity&quot;, &quot;type&quot;: &quot;int&quot;}<br>  ]<br>}</pre><p>Data (Binary, but it represents):</p><pre>{<br>  &quot;Date&quot;: &quot;2025-01-20&quot;,<br>  &quot;Product&quot;: &quot;Widget A&quot;,<br>  &quot;Price&quot;: 25.00,<br>  &quot;Quantity&quot;: 10<br>}</pre><h4>Use Case:</h4><ul><li>Streaming pipelines in <strong>Apache Kafka</strong> where schema evolution is critical.</li><li>Data exchange between microservices with enforced structure.</li><li><strong>Avro</strong> for ETL pipelines where schema evolution and compact storage are priorities.</li></ul><h3>3. SAS (Statistical Analysis System)</h3><h4>Pros:</h4><ul><li><strong>Rich metadata</strong>: Embedded metadata includes variable names, labels, and types, making it excellent for analytical projects.</li><li><strong>Designed for analytics</strong>: Well-suited for statistical and predictive modeling use cases, especially in SAS environments.</li><li><strong>Reliable</strong>: Frequently used in enterprise and regulated industries like healthcare and finance due to its robust handling of complex datasets.</li></ul><h4>Cons:</h4><ul><li><strong>Proprietary format</strong>: Requires SAS tools or compatible software for access, which may incur licensing costs.</li><li><strong>Not cloud-native</strong>: Integration with modern cloud-based big data platforms can be limited compared to more open formats.</li><li><strong>Large file sizes</strong>: Tends to produce larger files than more optimized formats like Parquet or Avro.</li></ul><h4>Example:</h4><p>SAS files are binary but contain structured metadata like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*85KH-YpOGyXJcYeN5wiDOA.png" /></figure><h4>Use Case:</h4><ul><li>Analytical projects in <strong>regulated industries</strong> (e.g., healthcare or finance).</li><li>Collaboration with teams using SAS software for data modeling or reporting.</li><li><strong>SAS</strong> when working with data from regulated industries or SAS-based analytics pipelines.</li></ul><h3>4. Parquet</h3><h4>Pros:</h4><ul><li><strong>Columnar storage</strong>: Optimized for analytical queries, as only the required columns are read, which improves query performance.</li><li><strong>Highly compressed</strong>: Built-in compression (e.g., Snappy) minimizes storage requirements without sacrificing speed.</li><li><strong>Schema support</strong>: Stores metadata and schema, ensuring compatibility and making data self-describing.</li><li><strong>Big data friendly</strong>: Works seamlessly with distributed processing frameworks like Spark, Hive, and Snowflake.</li></ul><h4>Cons:</h4><ul><li><strong>Not human-readable</strong>: Like Avro, Parquet files are in binary format and require tools for viewing and processing.</li><li><strong>Less suitable for row-based processing</strong>: Best for analytical workloads, not transactional ones that require frequent row-level updates.</li></ul><h4>Example:</h4><p>Parquet files are binary, but here’s an equivalent <strong>columnar structure</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*sYr6QypRx_hTirtddbx58w.png" /></figure><p>Each column is stored separately in compressed format.</p><h4>Use Case:</h4><ul><li>Querying large datasets in <strong>Snowflake</strong>, <strong>BigQuery</strong>, or <strong>Athena</strong> where only specific columns are accessed.</li><li>Storing data in <strong>S3</strong> for big data analytics using <strong>Spark</strong> or <strong>Hive</strong>.</li><li><strong>Parquet</strong> for Snowflake queries or large-scale analytics due to its columnar storage benefits.</li></ul><h3>When to Use Each Format</h3><ol><li><strong>CSV</strong>:</li></ol><ul><li>Best for small, simple datasets or when human-readability is critical.</li><li>Ideal for ad-hoc file exchanges and non-technical audiences.</li></ul><p><strong>2. Avro </strong>:</p><ul><li>Best for streaming data (e.g., Kafka) or when schema evolution is necessary.</li><li>Useful in ETL pipelines requiring compact, schema-based storage.</li></ul><p><strong>3. SAS</strong>:</p><ul><li>Ideal for projects requiring statistical analysis in SAS environments.</li><li>Suitable for regulatory environments where metadata richness is key.</li></ul><p><strong>4. Parquet</strong>:</p><ul><li>Best for large-scale analytics and queries in data lakes or data warehouses.</li><li>Optimal for use in big data ecosystems like Snowflake, AWS S3, or GCP BigQuery.</li></ul><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f95b948eb76d" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/comparing-csv-avro-sas-and-parquet-pros-cons-and-use-cases-in-data-engineering-f95b948eb76d">Comparing CSV, Avro, SAS, and Parquet: Pros, Cons, and Use Cases in Data Engineering</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>