<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 3254988796aaa-code</title>
    <description>The latest articles on DEV Community by 3254988796aaa-code (@3254988796aaacode).</description>
    <link>https://dev.to/3254988796aaacode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4227533%2F49481b9b-cb7b-4cdd-a291-2da0276438c8.png</url>
      <title>DEV Community: 3254988796aaa-code</title>
      <link>https://dev.to/3254988796aaacode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/3254988796aaacode"/>
    <language>en</language>
    <item>
      <title>Building a Hadoop + Spark Data Warehouse with a Text-to-SQL AI Assistant</title>
      <dc:creator>3254988796aaa-code</dc:creator>
      <pubDate>Thu, 05 Nov 2026 03:30:55 +0000</pubDate>
      <link>https://dev.to/3254988796aaacode/building-a-hadoop-spark-data-warehouse-with-a-text-to-sql-ai-assistant-jhg</link>
      <guid>https://dev.to/3254988796aaacode/building-a-hadoop-spark-data-warehouse-with-a-text-to-sql-ai-assistant-jhg</guid>
      <description>&lt;p&gt;Building a data warehouse is a classic data engineering task. But what if you could add an AI assistant that allows users to query the warehouse using natural language? &lt;/p&gt;

&lt;p&gt;I recently finished a project that does exactly this. Here is a breakdown of the architecture and how the Text-to-SQL feature works.&lt;/p&gt;

&lt;h2&gt;
  
  
  📦 The Dataset &amp;amp; Tech Stack
&lt;/h2&gt;

&lt;p&gt;I used the Olist Brazilian E-commerce dataset (approx. 100k orders). &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Storage &amp;amp; Compute:&lt;/strong&gt; Hadoop 3.3.6 (HDFS + YARN), Hive 4.0.0, Spark 3.5.1&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metastore:&lt;/strong&gt; PostgreSQL 16&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualization:&lt;/strong&gt; Tableau Public&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏗️ The 4-Layer Architecture
&lt;/h2&gt;

&lt;p&gt;I implemented a standard dimensional data warehouse model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;ODS (Operational Data Store):&lt;/strong&gt; Raw data ingestion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DWD (Data Warehouse Detail):&lt;/strong&gt; Cleaned and conformed data (using PySpark for ETL).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DWS (Data Warehouse Summary):&lt;/strong&gt; Aggregated data for specific domains (e.g., user behavior, product sales).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ADS (Application Data Service):&lt;/strong&gt; The final tables used for BI reporting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Pro tip:&lt;/em&gt; I used Parquet + Snappy for storage efficiency and enforced ETL through Spark SQL to avoid Hive-on-Tez permission headaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 The AI Twist: Text-to-SQL Assistant
&lt;/h2&gt;

&lt;p&gt;The most interesting part of this project is the &lt;strong&gt;Text-to-SQL assistant&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I integrated an LLM (Qwen) via prompt engineering. By feeding it the schema descriptions, business rules, and few-shot examples, the AI generates Hive SQL based on user questions. &lt;/p&gt;

&lt;p&gt;In my tests, it generated SQL that matched the official ADS-layer results &lt;strong&gt;100%&lt;/strong&gt; of the time on 3 complex business questions. The interface is built with &lt;strong&gt;Streamlit&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📈 Actionable Insights
&lt;/h2&gt;

&lt;p&gt;The warehouse isn't just for show. One of the key insights from the RFM (Recency, Frequency, Monetary) analysis was that the "Important to retain" customer segment makes up &lt;strong&gt;23.5%&lt;/strong&gt; of the user base—making them the prime target for re-engagement campaigns.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Check out the Code
&lt;/h2&gt;

&lt;p&gt;The entire ETL process, schema definitions, and the Streamlit AI assistant code are open-sourced. &lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/3254988796aaa-code/olist-data-warehouse" rel="noopener noreferrer"&gt;https://github.com/3254988796aaa-code/olist-data-warehouse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me know what you think! Have you tried integrating LLMs into traditional data stack workflows?&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>bigdata</category>
      <category>ai</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I Extracted Data from 783 PDFs with 97% Verified Accuracy (A Data Engineering Case Study)</title>
      <dc:creator>3254988796aaa-code</dc:creator>
      <pubDate>Thu, 05 Nov 2026 03:27:14 +0000</pubDate>
      <link>https://dev.to/3254988796aaacode/how-i-extracted-data-from-783-pdfs-with-97-verified-accuracy-a-data-engineering-case-study-57ff</link>
      <guid>https://dev.to/3254988796aaacode/how-i-extracted-data-from-783-pdfs-with-97-verified-accuracy-a-data-engineering-case-study-57ff</guid>
      <description>&lt;p&gt;Have you ever tried to extract structured data from hundreds of messy PDF documents? It's a nightmare. &lt;/p&gt;

&lt;p&gt;In this post, I want to share a recent project where I built an end-to-end pipeline to extract a &lt;strong&gt;&lt;code&gt;(company, period) × 40 fields&lt;/code&gt;&lt;/strong&gt; data panel from &lt;strong&gt;783 real A-share annual report PDFs&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;But the real challenge wasn't just extraction—it was &lt;strong&gt;verifiability&lt;/strong&gt;. How do you prove the extracted numbers are actually correct?&lt;/p&gt;

&lt;p&gt;Here is how I solved it.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Architecture
&lt;/h2&gt;

&lt;p&gt;The pipeline is designed to be fully reproducible. It goes through several stages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cataloging &amp;amp; Page Packing:&lt;/strong&gt; Handling huge PDF files efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extraction:&lt;/strong&gt; Using &lt;code&gt;PyMuPDF&lt;/code&gt; and customized rules to locate tables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation &amp;amp; Quality Gates:&lt;/strong&gt; The core of the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Panel Construction:&lt;/strong&gt; Merging everything into a tidy dataset.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🛡️ The Core Feature: "Why should anyone trust this table?"
&lt;/h2&gt;

&lt;p&gt;Every data engineer knows that extraction is easy, but &lt;strong&gt;data quality&lt;/strong&gt; is hard. I built three orthogonal validators into the system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accounting identity checks:&lt;/strong&gt; Do the numbers add up?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-period reconciliation:&lt;/strong&gt; Measuring the same metric from two independent reports and comparing them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope checks:&lt;/strong&gt; Ensuring the data matches the expected boundaries.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Quality Gate
&lt;/h3&gt;

&lt;p&gt;I used a &lt;code&gt;quality_rules.yaml&lt;/code&gt; file to define pass/fail thresholds. If the pipeline fails a gate, it exits with a non-zero code. This prevents bad data from silently polluting the final dataset.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 The Results
&lt;/h2&gt;

&lt;p&gt;To prove the system works, I manually verified &lt;strong&gt;234 measurement points&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The result? The parser achieved &lt;strong&gt;97.12% accuracy&lt;/strong&gt; (Wilson 95% CI: 93.85%–98.67%). &lt;/p&gt;

&lt;p&gt;More importantly, the system &lt;em&gt;knows what it doesn't know&lt;/em&gt;. It explicitly rejected 212 abstracts where column counts didn't match, refusing to output bad numbers rather than guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Open Source
&lt;/h2&gt;

&lt;p&gt;If you are interested in how the pipeline was built, or if you are dealing with similar PDF extraction challenges, the full code and reproducible workflow are available on GitHub. &lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback on the cross-period reconciliation design!&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/3254988796aaa-code/annual-report-data-base" rel="noopener noreferrer"&gt;https://github.com/3254988796aaa-code/annual-report-data-base&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>python</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
