TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Nasty, a cross-warehouse, type-checked, unit-testable analytics library

47 点作者 tdfirth大约 1 年前
Hey HN - our team wants to open source a project called NASTY (NASTY Abstract Syntax Tree thingY) that we built for ourselves. NASTY was built to maintain testable&#x2F;composable data pipelines. Our team was ripping our hair out trying to maintain dbt&#x2F;SQL scripts across different data warehouses (Redshift, BigQuery, Postgres, Snowflake) on top of ever shifting data foundations maintained by our customer&#x27;s internal data teams. NASTY is the result of our learnings from field experience.<p>We wanted to write abstractions so that we could reuse code. We wanted to bundle those abstractions into libraries. We wanted to statically analyze our models so that we caught more errors before production. We wanted a fast unit test suite that you could iterate on locally without connecting to a data warehouse.<p>In short, we wanted to use all the same practices we used for building our other software. Tools like dbt made a great start at importing these kinds of practices into analytics, but there are many great aspects of the software engineering workflow that still aren&#x27;t easy to replicate in data.<p>We&#x27;ve found it to be a super productive way to work, and we thought others might want to use it too. It&#x27;s very early days so we&#x27;ve put up a page for to explain it, and we&#x27;ve made some executable examples for people to have a go. Let us know what you think!<p>FAQ:<p>Is NASTY an ORM? A SQL builder?<p>Neither! NASTY is kinda it&#x27;s own thing. NASTY is more like a minimal relational algebra programming language shipped as a Typescript library. It borrows a bunch of learnings from other programming languages and applies them to OLAP programming &#x2F; data engineering. It&#x27;s an important distinction, because it totally changes the way you can think about building transformations.<p>Why TypeScript? Why not Python?<p>The 100% honest answer is we had a ton of typescript experience and we had a node&#x2F;react app with pulumi&#x27;s TS apis. We like typescript and by being a library instead of a full programming language, we can leverage things like vitest, eslint, node, TS&#x27;s language server, TSdoc, etc.

4 条评论

cotera-grant大约 1 年前
Hi, I&#x27;m Grant, I&#x27;m one of the primary NASTY maintainers along with Tom and TJ.<p>One thing that&#x27;s on the getnasty.dev but worth calling out explicitly with the link are the ruby koans style TDD learn by examples we have for NASTY. They should just require NodeJS in whatever form is easiest.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;coterahq&#x2F;learn-nasty-by-example">https:&#x2F;&#x2F;github.com&#x2F;coterahq&#x2F;learn-nasty-by-example</a><p>Another small but interesting thing that I think people who work in SQL would find cool are `invariants`, which do runtime data integrity checks<p><a href="https:&#x2F;&#x2F;getnasty.dev&#x2F;docs&#x2F;invariants" rel="nofollow">https:&#x2F;&#x2F;getnasty.dev&#x2F;docs&#x2F;invariants</a>
gigatexal大约 1 年前
What a bold name choice. Not sure how well it will go over when I tell the boss I’m doing something Nasty to the codebase. Hahaha
评论 #39646042 未加载
zurawiki大约 1 年前
I&#x27;m really happy to see we&#x27;re exploring ways to make SQL more maintainable. TypeScript did a lot for the JS ecosystem, giving us nice autocomplete and making many kinds of bugs impossible to type-check, adding this kind of type-system to SQL makes a bunch of sense.<p>I selfishly hope this can smooth over all the missing SQL functionality in redshift<p>Very cool work team!
评论 #39643800 未加载
statueofibberty大约 1 年前
Super excited for this! We made this because of how hard it was to track how things were breaking downstream and hopefully it makes some data person&#x27;s life easier&#x2F;more manageable