Skip to content

A custom SQLGlot transformation that rewrites AGE() into Spark SQL syntax

License

Notifications You must be signed in to change notification settings

apotheque/sqlglot-age-transform

Repository files navigation

sqlglot-age-transform

A small Python package providing a custom SQLGlot transformation that rewrites the PostgreSQL-style AGE() function into an equivalent Spark SQL expression.

The project includes:

  • An SQLGlot transformation implementation in src/sqlglot_age_transform/transform.py
  • Basic tests under tests/

🚀 Prerequisites

This project uses uv, a modern Python package manager and workflow tool. How to install uv?

Requires Python 3.12+.


📁 Setup

  1. Fork this repository, then clone the fork
git clone https://github.com/your-username/sqlglot-age-transform
cd sqlglot-age-transform
  1. Install all dependencies
uv sync --all-extras
  1. Activate pre-commit hooks
uv run pre-commit install

🧹 Linting & Formatting

Check (lint only):

uv run ruff check

Auto-fix lint issues where supported:

uv run ruff check --fix

Format code:

uv run ruff format

🧪 Tests

Run tests:

uv run pytest

About

A custom SQLGlot transformation that rewrites AGE() into Spark SQL syntax

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages