HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dbt-labs
dbt-utils
Makefile2023–2024
dbt-labs / dbt-utils

dbt-utils

Utility functions for dbt projects.

2Distinct people
2Mentions
0Explicit recommenders
1.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Utility functions for dbt projects.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month2 dated mentions

Observed mentions: 2023-02-09 17:13:46 UTC to 2024-03-08 18:00:34 UTC.

012023-02-01 00:00:00 UTC to 2023-03-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 20232023-03-01 00:00:00 UTC to 2023-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-01 00:00:00 UTC to 2023-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-01 00:00:00 UTC to 2023-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-06-01 00:00:00 UTC to 2023-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-01 00:00:00 UTC to 2023-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-08-01 00:00:00 UTC to 2023-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsAug 20232023-09-01 00:00:00 UTC to 2023-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-10-01 00:00:00 UTC to 2023-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-11-01 00:00:00 UTC to 2023-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2024-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-01 00:00:00 UTC to 2024-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-01 00:00:00 UTC to 2024-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 20232023-02-01 00:00:00 UTC2023-03-01 00:00:00 UTC101
Mar 20232023-03-01 00:00:00 UTC2023-04-01 00:00:00 UTC000
Apr 20232023-04-01 00:00:00 UTC2023-05-01 00:00:00 UTC000
May 20232023-05-01 00:00:00 UTC2023-06-01 00:00:00 UTC000
Jun 20232023-06-01 00:00:00 UTC2023-07-01 00:00:00 UTC000
Jul 20232023-07-01 00:00:00 UTC2023-08-01 00:00:00 UTC000
Aug 20232023-08-01 00:00:00 UTC2023-09-01 00:00:00 UTC000
Sep 20232023-09-01 00:00:00 UTC2023-10-01 00:00:00 UTC000
Oct 20232023-10-01 00:00:00 UTC2023-11-01 00:00:00 UTC000
Nov 20232023-11-01 00:00:00 UTC2023-12-01 00:00:00 UTC000
Dec 20232023-12-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
Jan 20242024-01-01 00:00:00 UTC2024-02-01 00:00:00 UTC000
Feb 20242024-02-01 00:00:00 UTC2024-03-01 00:00:00 UTC000
Mar 20242024-03-01 00:00:00 UTC2024-04-01 00:00:00 UTC101

What Hacker News says

2 sources
> I selfishly hope this can smooth over all the missing SQL functionality in redshift Hi! I'm Grant, I work at Cotera and wrote most of the warehouse compatibility stuff for NASTY Redshift is the bane of my existence. It was definitely the hardest warehouse to write a NASTY compatible SQL gen for. A couple of annoyances that immediately come to mind. 1. Redshift Query Planner does wild stuff At Cotera we'll typically develop analytics libraries on one warehouse working closely with a customer and use the same library for other customers afterwards. A library will go to prod on one warehouse and then get start running on others as new customers with different warehouses want the functionality. Moving a library between Snowflake, BigQuery an Postgres is almost never a problem performance wise. In, Redshift the semantics will be correct but
Read the rest
performance can unexpectedly fall off a cliff for innocuous stuff. We typically write a bunch of unit tests so it's pretty easy to refactor, but I've been shocked at the things that Redshift can't optimize that everyone else had no problem with 2. Redshift does silly stuff with types of literals. with cte as (select *, 'foo' as "bar" from "cotera_data".foo) select coalesce("bar", 'baz') from cte; Fails with the error `[XX000] ERROR: failed to find conversion function from "unknown" to text` Because 'foo' is passed as `any` type... this fixes is but the error is bizarre and shows up way far away from the problem with cte as (select *, 'foo'::text as "bar" from "cotera_data".foo) select coalesce("bar", 'baz') from cte; (NASTY now fixes this for you when it detects it will happen) 3. The `super` type breaks referential transparency Here's just one head scratching example, but there are many super type limitations -- Allowed with bar as (select (json_parse('{"a": 1}')) as foo) select foo.a from bar; -- Not allowed select (json_parse('{"a": 1}')).a as foo -- [0A000] ERROR: applying array subscript on complex expression of SUPER type is currently not supported 4. Leader Only vs Compute Node Functions. Basic things like `generate_series` blow up in surprising ways From the NASTY source code for Redshift // Valid redshift // ``` // select generate_series(0, 10); // ``` // // Not valid redshift // ``` // -- Inserts run on compute nodes // insert into foo (a) ( // -- Leader only function // select generate_series(0, 10) as a // ) // ``` // // This is because `generate_series` is a leader only function, so it can’t be run on worker nodes // https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_functions_leader_node_only.html // https://docs.aws.amazon.com/redshift/latest/dg/c_sql-functions-leader-node.html // https://stackoverflow.com/questions/62716606/redshift-loading-data-issue-specified… // https://stackoverflow.com/questions/17282276/using-sql-function-generate-series-in… // // Recurive CTEs are NOT supported in subqueries // ``` // -- Not valid // select \* from ( // with recursive t(n) as ( // select 1::integer union all select n + 1 from t where n < 100 // ) select n from t // ); // ``` // To get around this, we can use the approach outlined by how dbt does ansi sql generate_series // https://github.com/dbt-labs/dbt-utils/blob/main/macros/sql/generate_series.sql const numbers = (upperBound: number) => { if (upperBound > 2 ** 11) { throw new Error( `We only support generating series in Reshift where the upperBound is less than ${ 2 ** 11 }` ); } return ` ( with p as ( select 0::integer as generated_number union all select 1::integer ), unioned as ( select ( p0.generated_number * power(2, 0) // ... Omitted for brevity + p11.generated_number * power(2, 11) ) as generated_number from p as p0 cross join p as p1 // ... Omitted for brevity cross join p as p11 ) select generated_number::integer from unioned where generated_number <= ${upperBound} order by generated_number ) `; };
In Show HN: Nasty, a cross-warehouse, type-checked, unit-testable analytics library

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.