Panduan Teknis: Freelance Python Programmer: High-Speed Analytics with Polars, DuckDB & Parquet. Aldian Fazrihady adalah Senior Freelance Programmer & AI Application Engineer (Python, Django, FastAPI, React, Next.js, TypeScript, Golang, RAG, MCP, Google ADK).

Replace slow OOM Pandas jobs by hiring senior freelance Python programmer Aldian Fazrihady to build zero-copy Polars, DuckDB, and Apache Parquet data pipelines.

import duckdb

def query_tenant_usage_metrics(parquet_glob_path: str, tenant_id: str) -> list[dict]:
    con = duckdb.connect(database=":memory:")
    query = """
        SELECT
            date_trunc('day', event_timestamp) AS usage_day,
            model_name,
            COUNT(*) AS total_requests,
            SUM(prompt_tokens + completion_tokens) AS total_tokens,
            QUANTILE_CONT(latency_ms, 0.95) AS p95_latency_ms
        FROM read_parquet($1, hive_partitioning = true)
        WHERE tenant_id = $2
        GROUP BY 1, 2
        ORDER BY 1 DESC, 4 DESC;
    """
    rel = con.execute(query, [parquet_glob_path, tenant_id])
    cols = [desc[0] for desc in rel.description]
    return [dict(zip(cols, row)) for row in rel.fetchall()]

Hubungi & Sewa di Upwork | Direktori 450+ Panduan


About the Author — Hire Freelance Programmer Aldian Fazrihady

Aldian Fazrihady is a Top-Rated Senior Freelance Programmer, Freelance Full Stack Developer, and AI Application Engineer with 15+ years of production software engineering experience and Google Cloud Professional Cloud Architect & Data Engineer certifications. He specializes in building custom LLM & autonomous AI agents, RAG pipelines, Next.js/React PWAs, Python (Django/FastAPI), Go microservices, and serverless cloud infrastructure on Google Cloud Run and AWS.

Hire Aldian Fazrihady on Upwork | Book 1-Day Programming Service ($100 USD via Polar) | View Live AI Portfolio | Portfolio Directory | Send a Direct Message

Related Engineering Articles

Freelance Programmer Specializations & Category Hubs