r/SQL • u/erinstellato • Jun 26 '26
r/SQL • u/Champion_Narrow • Jun 24 '26
Amazon Redshift AWS Glue crawler creating CSV table incorrectly and splitting quoted fields with commas
I'm running into an issue with an AWS Glue crawler and I'm not sure if the problem is the crawler, classifier, or the source file.
I have two CSV datasets with what appears to be the same structure. One dataset is crawled correctly and the other is not.
The CSV contains values like:
12345,"Smith, John",98765The older table was created as:
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'and correctly keeps "Smith, John" in a single column.
The newer table is consistently created as:
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','with table properties showing:
classification='csv'
areColumnsQuoted='false'As a result, fields containing commas are split across columns. For example:
name_field = Smith
id_field = Johninstead of:
name_field = Smith, JohnWhat I've already tried:
- Deleted the Glue table entirely
- Re-ran the crawler
- Removed a custom classifier that was previously attached
Added a CSV classifier with:
- Delimiter = comma
- Quote symbol = double quote
- Deleted and recreated the table through the crawler multiple times
The crawler still recreates the table as:
ROW FORMAT DELIMITEDand continues setting:
areColumnsQuoted='false'The crawler is configured to recrawl all files. The source file definitely contains quoted values with embedded commas.
My questions are:
- Has anyone seen Glue infer a CSV this way even when quoted fields exist?
- Is there a way to force OpenCSVSerde during crawler creation?
- Are there known file characteristics that cause Glue to ignore quoted fields and fall back to a simple delimited format?
- Is there a way to debug why Glue is deciding
areColumnsQuoted=false?
Any ideas would be appreciated. I've spent quite a bit of time changing classifiers and recreating the table but the crawler continues to generate the same table definition.
r/SQL • u/Top-Bullfrog-376 • Jun 24 '26
Discussion An odd Impala Query Observation
There was no HIVE/Impala/Hadoop flair, and those subreddits seem stale...
I made a mistake today that turned into an observed possible efficiency opportunity, and I'm not sure why.
I have two giant tables of call data. The tables are RDBMs tables that have just been dumped into a data lake (HDFS).
Someone had originally written the query without partition pruning. When "fixing," I messed up when adding my partition criteria in order to get the pervious months data.
There were two tables that were being joined, table i and table ia. I did:
where i.data_date >= 20260501
AND ia.data_date <= 20260531.
I thought I had screwed up, but the query ran in less than 30 seconds. Figuring it wouldn't be a big deal to put the appropriate uppper and lower bounds on each table, I revised the same query:
where i.data_date >= 20260501
AND i.data_date <=20260531
AND ia.data_date >= 20260501
AND ia.data_date <= 20260531.
When I ran the query again, it took almost 3 minutes to return the same row count of about 700K records.
Did I just get lucky? Is it possible that being LESS specific allowed the optimizer to somehow created more efficient join plan? I'm wondering if there is something going on about partitions, parquet stats, and buckets that maybe isn't fully visible to me.
Maybe I just got lucky and there were fewer queries running, but because of our platform I can't actually see the useful information about how a query executes, how many workers, bandwidth, etc on the target system. But is it possible there are some weird things going on about fewer bounds = different/more efficient logic in execution?
r/SQL • u/Natural-Fall-7146 • Jun 24 '26
PostgreSQL I built an interactive visualization of how INNER JOIN actually works
Every time someone asks me to explain JOIN I end up drawing
tables on paper. So I built this instead.
It animates the actual lookup process — shows which rows match,
which don't, and how the result table gets built step by step.
Try it free: sqlselect.net
Would love feedback from this community — what other concepts
would be useful to visualize?
r/SQL • u/Rare-Ad6166 • Jun 24 '26
PostgreSQL Postgresql on Vs code?
Anybody here uses postgresql on vscode or pg admin is just better long term?
r/SQL • u/timvancann • Jun 24 '26
Discussion Interactive ERD explorer for DBML files — trace how tables connect, fully in the browser
reddit.comr/SQL • u/Gloomy-Wolverine-900 • Jun 23 '26
Discussion help on sql interview
Hello!
I am not very proud of it but I kinda overstated my SQL experience on my resume and now I’ve moved forward in the interview process. I have an interview with a manager next week, and HR told me that he will include some SQL-related questions.
I did study SQL a bit in college, mainly in a business intelligence context, but that's it.. It's not a developper role so I don't think the questions will be advanced, it’s more of a business-facing technico-functional position.
Do you guys have any idea what kind of SQL questions they might ask? I’ve already watched some YouTube videos covering the basics like SELECT, JOIN, WHERE, etc., but I’m not sure if that will be enough.
Thanks a lot
edit: I'm not in IT, it's a supply chain role
r/SQL • u/whohasgoal • Jun 24 '26
PostgreSQL [HELP!] I need help about my game's database
savelollie.comHello guys! I built a game that every people in world effects the situation of the game. But I have some problems about database. I can't pay too öuch money for itand I created a FOR UPDATE in the database to push the datas on the line. But if I have a lot players I think FOR UPTADE is not gonna be enough. What can i do for it! This is a game about a shark and fish. And the distance between them changes according that who did you feed. Every person has one bait to feed per day! Can someone help me?
r/SQL • u/moneyplughub • Jun 23 '26
Oracle Built a modular "Plug In OS" in Notion to automate my financial funnels and content workflows. Here's the breakdown.
r/SQL • u/ChristianPacifist • Jun 23 '26
Discussion Has anyone encountered prejudice or skepticism when they learn one dialect of SQL and transition to another at another org?
The first dialect of SQL a person learns SQL with (or the first they use extensively) is heavily influential in developing one's style of SQL writing, and this can lead to prejudice or skepticism when one transitions to using other dialects of SQL with different practices, especially at a new org.
I find that those who began using SQL Server for instance tend to be obsessed with performance tuning and write in a more complex procedural way given the seamless integration of T-SQL control structures into the language. When someone who started out in SQL Server transitions to using another dialect of SQL, they may be criticized for writing over-engineered code and creating needless optimization, especially when using more forgiving big-data-centric SQL platforms. However, the discipline of SQL Server folks must be recognized!
I find that those (like myself) who began using Oracle, which did not have private temporary tables for the longest time, tend to be very good at writing and comprehending long complex SELECT statements and common table expressions. Oracle folks have a knack for tackling "confusing" code head on since they were forced to write "confusing" code and may naturally avoid the bite sized more linear code folks using other versions of SQL with more readily-accessible temp tables consider "table stakes". They may be criticized for writing verbose or "spaghetti" code when transitioning to other versions of SQL with historically more powerful read-only capabilities, but they are the folks you want on hand if you need to solve a SQL puzzle with one SELECT statement or untangle a mess!
Does anyone else have any other stories or experience with folks learning SQL using one dialect and then appearing idiosyncratic or facing prejudice or skepticism when they transition to another dialect especially at another org where they aren't familiar with the other dialect? A related phenomenon too is when one org migrates to another SQL version and translates their code without refactoring leading to code in one SQL dialect written using the common practices of another one.
r/SQL • u/NeedleworkerBig1291 • Jun 22 '26
SQL Server How do I level up to writing complex SQL stored procedures in real industrial systems?
Hey everyone,
I work with industrial systems (MES/SCADA) and I've been diving deep into complex stored procedures lately — we're talking about reports that pull data from multiple AMPLA servers, cross dozens of tables with chains of LEFT JOINs using different aliases for the same table (day/month/year windows), UNION blocks for each KPI, dynamic date calculations, fallback logic between reconciled data and raw sensor data, and so on.
I can read and understand the code, but I want to level up to the point where I can write and optimize this kind of procedure from scratch.
What I'm specifically struggling with:
- Designing the JOIN structure when you need the same table filtered by multiple time windows simultaneously
- Knowing when to use subqueries vs more aliases vs temp tables
- Optimizing performance when the procedure has 100+ INSERT/SELECT blocks
- Best practices for error handling (TRY/CATCH around external server calls that might be down)
Any books, courses, YouTube channels or just general advice would be hugely appreciated. Preferably things that go beyond the basic SELECT/WHERE stuff and actually cover real-world complexity.
Thanks in advance 🙏
r/SQL • u/wassaman • Jun 21 '26
SQLite I spent 5 years working on a hand-drawn SQL detective game that comes out next month!
r/SQL • u/pookypocky • Jun 22 '26
SQL Server Why am I getting a syntax error on my nested CTE?
I have a table with the following relevant columns: solicitor_type, date_from, date_to. The date fields are fuzzy, stored in YYYYMMDD format, although people don't have to fill in the whole thing - they could be YYYY, or YYYYMM, etc. I'm doing some iteration through them to test and convert them to actual dates. that part is working fine! Then I want to find people who have a date from or date to in the last three months, that part is also working fine:
with allsols as (
select id, [various date from and to conversions]
from solicitors
where solicior_type in (x, y, z)
select *
from allsols
where datediff(mm, datefrom, getdate()) < 4 or
datediff(mm, dateto, getdate()) < 4( ignore the field names datefrom and dateto - they are the results of converting date_from and date_to to actual dates)
but now I want to wrap that into another cte so I can include it in a larger query
with recentchanges as (
with allsols as (
select id, [various date from and to conversions]
from solicitors
where solicior_type in (x, y, z))
select *
from allsols
where datediff(mm, datefrom, getdate()) < 4 or
datediff(mm, dateto, getdate()) < 4)
select * from recentchangesand I'm getting syntax errors, specifically pointing to the name allsols in the inner cte. What am I missing here?
r/SQL • u/dbForge • Jun 23 '26
Discussion How to use ChatGPT to write SQL JOIN queries
r/SQL • u/Iva1996 • Jun 22 '26
Oracle 1z0-171 Exam
Hello,
Do you know any free study materials other than UDEMY courses to help me through 1z0-171 exam?
r/SQL • u/datareadit • Jun 22 '26
Discussion Platform for SQL Contribution
I am coming from Data Science background and completed my masters in it. I have good understanding of SQL and I am looking for opensource contribution from where I get real world experience of Queries.
Does any one knows from where I can get or any platform.
Thanks ✨️ in advance
r/SQL • u/Champion_Narrow • Jun 22 '26
Amazon Redshift Putting csv into to AWS
I am trying to put a CSV into AWS so that I can download it on SQL. Problem is that the name field is getting split up because of the , in the name.
r/SQL • u/justintxdave • Jun 22 '26
Discussion DBeaver Community Edition 26.1.1 is now available
reddit.comr/SQL • u/Effective_Ocelot_445 • Jun 22 '26
MySQL What SQL skill do you use most often in data engineering?
Iam curious which SQL concepts or techniques are used the most in real-world data engineering projects.
Discussion Building an open-source database client - developer survey
tabularis.devHi everyone 👋
We’re building Tabularis, an open-source database client designed by developers, for developers.
This is a short developer survey (2 min) to understand what people actually need from modern database tools.
Our goal is to build something that combines:
- PostgreSQL, MySQL, SQLite and more
- Plugin support
- Notebooks
- AI-assisted workflows
- A fast, clean UI
- A fully open-source ecosystem
But instead of guessing, we want to hear directly from developers, DBAs and data engineers.
We’d love your input on:
- What tools you currently use
- What frustrates you
- What’s missing in existing solutions
- What would make you switch
Every response helps shape the roadmap.
Thanks a lot for your time 🙌
r/SQL • u/Fancy-Newspaper2991 • Jun 22 '26
SQL Server I was struggling with 100+ line legacy SQL queries at work, so I built a simple tool to visualize their data flow
Hey everyone
I wanted to share a tool I built to solve a problem I've been facing at my job.
Lately, I’ve been forced to deal with messy legacy SQL queries and stored procedures that are over 100 lines long. I had no idea what half the tables did, where the data came from, or how it joined together. It was just exhausting to track the flow by scrolling through a wall of text.
I just wanted something simple to show me the visual flow of the query, so I built **Query-Flow** (part of Quackalytics).
It takes your SQL and turns it into an interactive map of nodes and connections so you can actually see the data lineage.
Since company queries can be sensitive, everything runs strictly inside your browser. No data ever touches a server, so it's 100% private.
I deployed it for free on Vercel just to help myself and anyone else dealing with this issue. I also added a couple of other micro-tools I use in my day-to-day.
If you want to test it out with your queries, here is the link: https://quackalytics.vercel.app/sql-flow
Would love to hear your thoughts!