databricks-table-valued-functions

Create and validate Databricks Table-Valued Functions for SQL query workflows.

1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/prashsub/vibe_coding_lakehouse_starter_repo --skill databricks-table-valued-functions-prashsub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-table-valued-functions
Source: https://github.com/prashsub/vibe_coding_lakehouse_starter_repo/tree/main/data_product_accelerator/skills/semantic-layer/02-databricks-table-valued-functions
Command: npx skills add https://github.com/prashsub/vibe_coding_lakehouse_starter_repo --skill databricks-table-valued-functions-prashsub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill streamlines the creation and deployment of Databricks Table-Valued Functions (TVFs), enabling natural language access to data through Genie Spaces and ensuring consistent, reusable business logic.

Core Features & Use Cases

  • End-to-End TVF Lifecycle: Covers planning, creation, deployment, and validation of TVFs.
  • Genie Compatibility: Ensures TVFs are optimized for natural language queries with proper parameter types (STRING for dates) and metadata.
  • Error Prevention: Provides critical rules and patterns to avoid common SQL errors like cartesian products, incorrect parameter ordering, and LIMIT clause issues.
  • Use Case: A data analyst needs to provide business users with a simple way to ask "What were the top 10 stores by revenue last quarter?". This Skill guides the creation of a get_top_stores_by_revenue TVF that can be directly queried by Genie.

Quick Start

Use the databricks-table-valued-functions skill to create a TVF that returns the top 5 stores by revenue for a specified date range.

Frequently Asked Questions about databricks-table-valued-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a Databricks table-valued function used for in a semantic layer?

A Databricks table-valued function (TVF) is used to build reusable, parameterized SQL queries for the semantic layer, enabling natural language data access through Genie Spaces. It encapsulates business logic so users can query data consistently without writing raw SQL.

How do I create parameterized queries for Genie Spaces?

You create parameterized queries for Genie Spaces by building table-valued functions with proper parameter typing, such as using STRING for dates. This Skill guides the end-to-end process including schema validation, null safety, and Asset Bundle deployment patterns.

What are the common SQL errors when building Databricks TVFs for Genie?

Common SQL errors when building Databricks TVFs include cartesian products, incorrect parameter ordering, and LIMIT clause issues. Proper parameter typing and following SQL best practices for null safety prevent these Genie Space compatibility problems.

Can I deploy Databricks table-valued functions using Asset Bundles?

Yes, you can deploy Databricks table-valued functions using Asset Bundles. This Skill provides deployment patterns and validation steps to ensure TVFs are correctly packaged and optimized for natural language querying within Genie Spaces.

When should I use a TVF instead of a standard SQL view in Databricks?

You should use a TVF instead of a standard SQL view when you need parameterized queries for dynamic filtering in Genie Spaces. TVFs support parameter typing and null safety, which are required for natural language data access and reusable semantic layer logic.