[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-databricks-databricks-dbsql":3,"mdc--2paybo-key":33,"related-repo-databricks-databricks-dbsql":2445,"related-org-databricks-databricks-dbsql":2565},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"databricks-dbsql","query and script Databricks SQL warehouses","Databricks SQL (DBSQL) advanced features and SQL warehouse capabilities. This skill MUST be invoked when the user mentions: \"DBSQL\", \"Databricks SQL\", \"SQL warehouse\", \"SQL scripting\", \"stored procedure\", \"CALL procedure\", \"materialized view\", \"CREATE MATERIALIZED VIEW\", \"pipe syntax\", \"|>\", \"geospatial\", \"H3\", \"ST_\", \"spatial SQL\", \"collation\", \"COLLATE\", \"ai_query\", \"ai_classify\", \"ai_extract\", \"ai_gen\", \"AI function\", \"http_request\", \"remote_query\", \"read_files\", \"Lakehouse Federation\", \"recursive CTE\", \"WITH RECURSIVE\", \"multi-statement transaction\", \"temp table\", \"temporary view\", \"pipe operator\". SHOULD also invoke when the user asks about SQL best practices, data modeling patterns, or advanced SQL features on Databricks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"databricks","Databricks","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdatabricks.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Data Analysis","data-analysis","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"SQL","sql",204,"https:\u002F\u002Fgithub.com\u002Fdatabricks\u002Fdatabricks-agent-skills","2026-07-12T08:04:08.678282",null,60,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002Fdatabricks\u002Fdatabricks-agent-skills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdatabricks\u002Fcopilot\u002Fskills\u002Fdatabricks-dbsql","---\nname: databricks-dbsql\ndescription: >-\n  Databricks SQL (DBSQL) advanced features and SQL warehouse capabilities.\n  This skill MUST be invoked when the user mentions: \"DBSQL\", \"Databricks SQL\",\n  \"SQL warehouse\", \"SQL scripting\", \"stored procedure\", \"CALL procedure\",\n  \"materialized view\", \"CREATE MATERIALIZED VIEW\", \"pipe syntax\", \"|>\",\n  \"geospatial\", \"H3\", \"ST_\", \"spatial SQL\", \"collation\", \"COLLATE\",\n  \"ai_query\", \"ai_classify\", \"ai_extract\", \"ai_gen\", \"AI function\",\n  \"http_request\", \"remote_query\", \"read_files\", \"Lakehouse Federation\",\n  \"recursive CTE\", \"WITH RECURSIVE\", \"multi-statement transaction\",\n  \"temp table\", \"temporary view\", \"pipe operator\".\n  SHOULD also invoke when the user asks about SQL best practices, data modeling\n  patterns, or advanced SQL features on Databricks.\ncompatibility: Requires databricks CLI (>= v1.0.0)\nmetadata:\n  version: \"0.1.0\"\nparent: databricks-core\n---\n\n# Databricks SQL (DBSQL) - Advanced Features\n\n## Quick Reference\n\n| Feature | Key Syntax | Since | Reference |\n|---------|-----------|-------|-----------|\n| SQL Scripting | `BEGIN...END`, `DECLARE`, `IF\u002FWHILE\u002FFOR` | DBR 16.3+ | [references\u002Fsql-scripting.md](references\u002Fsql-scripting.md) |\n| Stored Procedures | `CREATE PROCEDURE`, `CALL` | DBR 17.0+ | [references\u002Fsql-scripting.md](references\u002Fsql-scripting.md) |\n| Recursive CTEs | `WITH RECURSIVE` | DBR 17.0+ | [references\u002Fsql-scripting.md](references\u002Fsql-scripting.md) |\n| Transactions | `BEGIN ATOMIC...END` | Preview | [references\u002Fsql-scripting.md](references\u002Fsql-scripting.md) |\n| Materialized Views | `CREATE MATERIALIZED VIEW` | Pro\u002FServerless | [references\u002Fmaterialized-views-pipes.md](references\u002Fmaterialized-views-pipes.md) |\n| Temp Tables | `CREATE TEMPORARY TABLE` | All | [references\u002Fmaterialized-views-pipes.md](references\u002Fmaterialized-views-pipes.md) |\n| Pipe Syntax | `\\|>` operator | DBR 16.1+ | [references\u002Fmaterialized-views-pipes.md](references\u002Fmaterialized-views-pipes.md) |\n| Geospatial (H3) | `h3_longlatash3()`, `h3_polyfillash3()` | DBR 11.2+ | [references\u002Fgeospatial-collations.md](references\u002Fgeospatial-collations.md) |\n| Geospatial (ST) | `ST_Point()`, `ST_Contains()`, 80+ funcs | DBR 16.0+ | [references\u002Fgeospatial-collations.md](references\u002Fgeospatial-collations.md) |\n| Collations | `COLLATE`, `UTF8_LCASE`, locale-aware | DBR 16.1+ | [references\u002Fgeospatial-collations.md](references\u002Fgeospatial-collations.md) |\n| AI Functions | `ai_query()`, `ai_classify()`, 11+ funcs | DBR 15.1+ | [references\u002Fai-functions.md](references\u002Fai-functions.md) |\n| http_request | `http_request(conn, ...)` | Pro\u002FServerless | [references\u002Fai-functions.md](references\u002Fai-functions.md) |\n| remote_query | `SELECT * FROM remote_query(...)` | Pro\u002FServerless | [references\u002Fai-functions.md](references\u002Fai-functions.md) |\n| read_files | `SELECT * FROM read_files(...)` | All | [references\u002Fai-functions.md](references\u002Fai-functions.md) |\n| Data Modeling | Star schema, Liquid Clustering | All | [references\u002Fbest-practices.md](references\u002Fbest-practices.md) |\n\n---\n\n## Common Patterns\n\n### SQL Scripting - Procedural ETL\n\n```sql\nBEGIN\n  DECLARE v_count INT;\n  DECLARE v_status STRING DEFAULT 'pending';\n\n  SET v_count = (SELECT COUNT(*) FROM catalog.schema.raw_orders WHERE status = 'new');\n\n  IF v_count > 0 THEN\n    INSERT INTO catalog.schema.processed_orders\n    SELECT *, current_timestamp() AS processed_at\n    FROM catalog.schema.raw_orders\n    WHERE status = 'new';\n\n    SET v_status = 'completed';\n  ELSE\n    SET v_status = 'skipped';\n  END IF;\n\n  SELECT v_status AS result, v_count AS rows_processed;\nEND\n```\n\n### Stored Procedure with Error Handling\n\n```sql\nCREATE OR REPLACE PROCEDURE catalog.schema.upsert_customers(\n  IN p_source STRING,\n  OUT p_rows_affected INT\n)\nLANGUAGE SQL\nSQL SECURITY INVOKER\nBEGIN\n  DECLARE EXIT HANDLER FOR SQLEXCEPTION\n  BEGIN\n    SET p_rows_affected = -1;\n    SIGNAL SQLSTATE '45000'\n      SET MESSAGE_TEXT = concat('Upsert failed for source: ', p_source);\n  END;\n\n  MERGE INTO catalog.schema.dim_customer AS t\n  USING (SELECT * FROM identifier(p_source)) AS s\n  ON t.customer_id = s.customer_id\n  WHEN MATCHED THEN UPDATE SET *\n  WHEN NOT MATCHED THEN INSERT *;\n\n  SET p_rows_affected = (SELECT COUNT(*) FROM identifier(p_source));\nEND;\n\n-- Invoke:\nCALL catalog.schema.upsert_customers('catalog.schema.staging_customers', ?);\n```\n\n### Materialized View with Scheduled Refresh\n\n```sql\nCREATE OR REPLACE MATERIALIZED VIEW catalog.schema.daily_revenue\n  CLUSTER BY (order_date)\n  SCHEDULE EVERY 1 HOUR\n  COMMENT 'Hourly-refreshed daily revenue by region'\nAS SELECT\n    order_date,\n    region,\n    SUM(amount) AS total_revenue,\n    COUNT(DISTINCT customer_id) AS unique_customers\nFROM catalog.schema.fact_orders\nJOIN catalog.schema.dim_store USING (store_id)\nGROUP BY order_date, region;\n```\n\n### Pipe Syntax - Readable Transformations\n\n```sql\n-- Traditional SQL rewritten with pipe syntax\nFROM catalog.schema.fact_orders\n  |> WHERE order_date >= current_date() - INTERVAL 30 DAYS\n  |> AGGREGATE SUM(amount) AS total, COUNT(*) AS cnt GROUP BY region, product_category\n  |> WHERE total > 10000\n  |> ORDER BY total DESC\n  |> LIMIT 20;\n```\n\n### AI Functions - Enrich Data with LLMs\n\n```sql\n-- Classify support tickets\nSELECT\n  ticket_id,\n  description,\n  ai_classify(description, ARRAY('billing', 'technical', 'account', 'feature_request')) AS category,\n  ai_analyze_sentiment(description) AS sentiment\nFROM catalog.schema.support_tickets\nLIMIT 100;\n\n-- Extract entities from text\nSELECT\n  doc_id,\n  ai_extract(content, ARRAY('person_name', 'company', 'dollar_amount')) AS entities\nFROM catalog.schema.contracts;\n\n-- General-purpose AI query with structured output\nSELECT ai_query(\n  'databricks-meta-llama-3-3-70b-instruct',\n  concat('Summarize this customer feedback in JSON with keys: topic, sentiment, action_items. Feedback: ', feedback),\n  returnType => 'STRUCT\u003Ctopic STRING, sentiment STRING, action_items ARRAY\u003CSTRING>>'\n) AS analysis\nFROM catalog.schema.customer_feedback\nLIMIT 50;\n```\n\n### Geospatial - Proximity Search with H3\n\n```sql\n-- Find stores within 5km of each customer using H3 indexing\nWITH customer_h3 AS (\n  SELECT *, h3_longlatash3(longitude, latitude, 7) AS h3_cell\n  FROM catalog.schema.customers\n),\nstore_h3 AS (\n  SELECT *, h3_longlatash3(longitude, latitude, 7) AS h3_cell\n  FROM catalog.schema.stores\n)\nSELECT\n  c.customer_id,\n  s.store_id,\n  ST_Distance(\n    ST_Point(c.longitude, c.latitude),\n    ST_Point(s.longitude, s.latitude)\n  ) AS distance_m\nFROM customer_h3 c\nJOIN store_h3 s ON h3_ischildof(c.h3_cell, h3_toparent(s.h3_cell, 5))\nWHERE ST_Distance(\n  ST_Point(c.longitude, c.latitude),\n  ST_Point(s.longitude, s.latitude)\n) \u003C 5000;\n```\n\n### Collation - Case-Insensitive Search\n\n```sql\n-- Create table with case-insensitive collation\nCREATE TABLE catalog.schema.products (\n  product_id BIGINT GENERATED ALWAYS AS IDENTITY,\n  name STRING COLLATE UTF8_LCASE,\n  category STRING COLLATE UTF8_LCASE,\n  price DECIMAL(10, 2)\n);\n\n-- Queries automatically case-insensitive (no LOWER() needed)\nSELECT * FROM catalog.schema.products\nWHERE name = 'MacBook Pro';  -- matches 'macbook pro', 'MACBOOK PRO', etc.\n```\n\n### http_request - Call External APIs\n\n```sql\n-- Set up connection first (one-time)\nCREATE CONNECTION my_api_conn\n  TYPE HTTP\n  OPTIONS (host 'https:\u002F\u002Fapi.example.com', bearer_token secret('scope', 'token'));\n\n-- Call API from SQL\nSELECT\n  order_id,\n  http_request(\n    conn => 'my_api_conn',\n    method => 'POST',\n    path => '\u002Fv1\u002Fvalidate',\n    json => to_json(named_struct('order_id', order_id, 'amount', amount))\n  ).text AS api_response\nFROM catalog.schema.orders\nWHERE needs_validation = true;\n```\n\n### read_files - Ingest Raw Files\n\n```sql\n-- Read JSON files from a Volume with schema hints\nSELECT *\nFROM read_files(\n  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fevents\u002F',\n  format => 'json',\n  schemaHints => 'event_id STRING, timestamp TIMESTAMP, payload MAP\u003CSTRING, STRING>',\n  pathGlobFilter => '*.json',\n  recursiveFileLookup => true\n);\n\n-- Read CSV with options\nSELECT *\nFROM read_files(\n  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fsales\u002F',\n  format => 'csv',\n  header => true,\n  delimiter => '|',\n  dateFormat => 'yyyy-MM-dd',\n  schema => 'sale_id INT, sale_date DATE, amount DECIMAL(10,2), store STRING'\n);\n```\n\n### Recursive CTE - Hierarchy Traversal\n\n```sql\nWITH RECURSIVE org_chart AS (\n  -- Anchor: top-level managers\n  SELECT employee_id, name, manager_id, 0 AS depth, ARRAY(name) AS path\n  FROM catalog.schema.employees\n  WHERE manager_id IS NULL\n\n  UNION ALL\n\n  -- Recursive: direct reports\n  SELECT e.employee_id, e.name, e.manager_id, o.depth + 1, array_append(o.path, e.name)\n  FROM catalog.schema.employees e\n  JOIN org_chart o ON e.manager_id = o.employee_id\n  WHERE o.depth \u003C 10  -- safety limit\n)\nSELECT * FROM org_chart ORDER BY depth, name;\n```\n\n### remote_query - Federated Queries\n\n```sql\n-- Query PostgreSQL via Lakehouse Federation\nSELECT *\nFROM remote_query(\n  'my_postgres_connection',\n  database => 'my_database',\n  query    => 'SELECT customer_id, email, created_at FROM customers WHERE active = true'\n);\n```\n\n---\n\n## Reference Files\n\nLoad these for detailed syntax, full parameter lists, and advanced patterns:\n\n| File | Contents | When to Read |\n|------|----------|--------------|\n| [references\u002Fsql-scripting.md](references\u002Fsql-scripting.md) | SQL Scripting, Stored Procedures, Recursive CTEs, Transactions | User needs procedural SQL, error handling, loops, dynamic SQL |\n| [references\u002Fmaterialized-views-pipes.md](references\u002Fmaterialized-views-pipes.md) | Materialized Views, Temp Tables\u002FViews, Pipe Syntax | User needs MVs, refresh scheduling, temp objects, pipe operator |\n| [references\u002Fgeospatial-collations.md](references\u002Fgeospatial-collations.md) | 39 H3 functions, 80+ ST functions, Collation types and hierarchy | User needs spatial analysis, H3 indexing, case\u002Faccent handling |\n| [references\u002Fai-functions.md](references\u002Fai-functions.md) | 13 AI functions, http_request, remote_query, read_files (all options) | User needs AI enrichment, API calls, federation, file ingestion |\n| [references\u002Fbest-practices.md](references\u002Fbest-practices.md) | Data modeling, performance, Liquid Clustering, anti-patterns | User needs architecture guidance, optimization, or modeling advice |\n\n---\n\n## Key Guidelines\n\n- **Always use Serverless SQL warehouses** for AI functions, MVs, and http_request\n- **Use `LIMIT` during development** with AI functions to control costs\n- **Prefer Liquid Clustering over partitioning** for new tables (1-4 keys max)\n- **Use `CLUSTER BY AUTO`** when unsure about clustering keys\n- **Star schema in Gold layer** for BI; OBT acceptable in Silver\n- **Define PK\u002FFK constraints** on dimensional models for query optimization\n- **Use `COLLATE UTF8_LCASE`** for user-facing string columns that need case-insensitive search\n- **Test SQL via CLI** (`databricks experimental aitools tools query`) or notebooks before deploying. If `--warehouse` is rejected on your CLI version, set `DATABRICKS_WAREHOUSE_ID` in the environment instead.\n",{"data":34,"body":39},{"name":4,"description":6,"compatibility":35,"metadata":36,"parent":38},"Requires databricks CLI (>= v1.0.0)",{"version":37},"0.1.0","databricks-core",{"type":40,"children":41},"root",[42,51,58,586,590,596,603,784,790,999,1005,1108,1114,1176,1182,1370,1376,1556,1562,1656,1662,1795,1801,1963,1969,2093,2099,2160,2163,2169,2175,2302,2305,2311,2439],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"databricks-sql-dbsql-advanced-features",[48],{"type":49,"value":50},"text","Databricks SQL (DBSQL) - Advanced Features",{"type":43,"tag":52,"props":53,"children":55},"h2",{"id":54},"quick-reference",[56],{"type":49,"value":57},"Quick Reference",{"type":43,"tag":59,"props":60,"children":61},"table",{},[62,91],{"type":43,"tag":63,"props":64,"children":65},"thead",{},[66],{"type":43,"tag":67,"props":68,"children":69},"tr",{},[70,76,81,86],{"type":43,"tag":71,"props":72,"children":73},"th",{},[74],{"type":49,"value":75},"Feature",{"type":43,"tag":71,"props":77,"children":78},{},[79],{"type":49,"value":80},"Key Syntax",{"type":43,"tag":71,"props":82,"children":83},{},[84],{"type":49,"value":85},"Since",{"type":43,"tag":71,"props":87,"children":88},{},[89],{"type":49,"value":90},"Reference",{"type":43,"tag":92,"props":93,"children":94},"tbody",{},[95,143,179,207,236,266,295,326,363,401,438,477,505,533,561],{"type":43,"tag":67,"props":96,"children":97},{},[98,104,129,134],{"type":43,"tag":99,"props":100,"children":101},"td",{},[102],{"type":49,"value":103},"SQL Scripting",{"type":43,"tag":99,"props":105,"children":106},{},[107,114,116,122,123],{"type":43,"tag":108,"props":109,"children":111},"code",{"className":110},[],[112],{"type":49,"value":113},"BEGIN...END",{"type":49,"value":115},", ",{"type":43,"tag":108,"props":117,"children":119},{"className":118},[],[120],{"type":49,"value":121},"DECLARE",{"type":49,"value":115},{"type":43,"tag":108,"props":124,"children":126},{"className":125},[],[127],{"type":49,"value":128},"IF\u002FWHILE\u002FFOR",{"type":43,"tag":99,"props":130,"children":131},{},[132],{"type":49,"value":133},"DBR 16.3+",{"type":43,"tag":99,"props":135,"children":136},{},[137],{"type":43,"tag":138,"props":139,"children":141},"a",{"href":140},"references\u002Fsql-scripting.md",[142],{"type":49,"value":140},{"type":43,"tag":67,"props":144,"children":145},{},[146,151,167,172],{"type":43,"tag":99,"props":147,"children":148},{},[149],{"type":49,"value":150},"Stored Procedures",{"type":43,"tag":99,"props":152,"children":153},{},[154,160,161],{"type":43,"tag":108,"props":155,"children":157},{"className":156},[],[158],{"type":49,"value":159},"CREATE PROCEDURE",{"type":49,"value":115},{"type":43,"tag":108,"props":162,"children":164},{"className":163},[],[165],{"type":49,"value":166},"CALL",{"type":43,"tag":99,"props":168,"children":169},{},[170],{"type":49,"value":171},"DBR 17.0+",{"type":43,"tag":99,"props":173,"children":174},{},[175],{"type":43,"tag":138,"props":176,"children":177},{"href":140},[178],{"type":49,"value":140},{"type":43,"tag":67,"props":180,"children":181},{},[182,187,196,200],{"type":43,"tag":99,"props":183,"children":184},{},[185],{"type":49,"value":186},"Recursive CTEs",{"type":43,"tag":99,"props":188,"children":189},{},[190],{"type":43,"tag":108,"props":191,"children":193},{"className":192},[],[194],{"type":49,"value":195},"WITH RECURSIVE",{"type":43,"tag":99,"props":197,"children":198},{},[199],{"type":49,"value":171},{"type":43,"tag":99,"props":201,"children":202},{},[203],{"type":43,"tag":138,"props":204,"children":205},{"href":140},[206],{"type":49,"value":140},{"type":43,"tag":67,"props":208,"children":209},{},[210,215,224,229],{"type":43,"tag":99,"props":211,"children":212},{},[213],{"type":49,"value":214},"Transactions",{"type":43,"tag":99,"props":216,"children":217},{},[218],{"type":43,"tag":108,"props":219,"children":221},{"className":220},[],[222],{"type":49,"value":223},"BEGIN ATOMIC...END",{"type":43,"tag":99,"props":225,"children":226},{},[227],{"type":49,"value":228},"Preview",{"type":43,"tag":99,"props":230,"children":231},{},[232],{"type":43,"tag":138,"props":233,"children":234},{"href":140},[235],{"type":49,"value":140},{"type":43,"tag":67,"props":237,"children":238},{},[239,244,253,258],{"type":43,"tag":99,"props":240,"children":241},{},[242],{"type":49,"value":243},"Materialized Views",{"type":43,"tag":99,"props":245,"children":246},{},[247],{"type":43,"tag":108,"props":248,"children":250},{"className":249},[],[251],{"type":49,"value":252},"CREATE MATERIALIZED VIEW",{"type":43,"tag":99,"props":254,"children":255},{},[256],{"type":49,"value":257},"Pro\u002FServerless",{"type":43,"tag":99,"props":259,"children":260},{},[261],{"type":43,"tag":138,"props":262,"children":264},{"href":263},"references\u002Fmaterialized-views-pipes.md",[265],{"type":49,"value":263},{"type":43,"tag":67,"props":267,"children":268},{},[269,274,283,288],{"type":43,"tag":99,"props":270,"children":271},{},[272],{"type":49,"value":273},"Temp Tables",{"type":43,"tag":99,"props":275,"children":276},{},[277],{"type":43,"tag":108,"props":278,"children":280},{"className":279},[],[281],{"type":49,"value":282},"CREATE TEMPORARY TABLE",{"type":43,"tag":99,"props":284,"children":285},{},[286],{"type":49,"value":287},"All",{"type":43,"tag":99,"props":289,"children":290},{},[291],{"type":43,"tag":138,"props":292,"children":293},{"href":263},[294],{"type":49,"value":263},{"type":43,"tag":67,"props":296,"children":297},{},[298,303,314,319],{"type":43,"tag":99,"props":299,"children":300},{},[301],{"type":49,"value":302},"Pipe Syntax",{"type":43,"tag":99,"props":304,"children":305},{},[306,312],{"type":43,"tag":108,"props":307,"children":309},{"className":308},[],[310],{"type":49,"value":311},"|>",{"type":49,"value":313}," operator",{"type":43,"tag":99,"props":315,"children":316},{},[317],{"type":49,"value":318},"DBR 16.1+",{"type":43,"tag":99,"props":320,"children":321},{},[322],{"type":43,"tag":138,"props":323,"children":324},{"href":263},[325],{"type":49,"value":263},{"type":43,"tag":67,"props":327,"children":328},{},[329,334,350,355],{"type":43,"tag":99,"props":330,"children":331},{},[332],{"type":49,"value":333},"Geospatial (H3)",{"type":43,"tag":99,"props":335,"children":336},{},[337,343,344],{"type":43,"tag":108,"props":338,"children":340},{"className":339},[],[341],{"type":49,"value":342},"h3_longlatash3()",{"type":49,"value":115},{"type":43,"tag":108,"props":345,"children":347},{"className":346},[],[348],{"type":49,"value":349},"h3_polyfillash3()",{"type":43,"tag":99,"props":351,"children":352},{},[353],{"type":49,"value":354},"DBR 11.2+",{"type":43,"tag":99,"props":356,"children":357},{},[358],{"type":43,"tag":138,"props":359,"children":361},{"href":360},"references\u002Fgeospatial-collations.md",[362],{"type":49,"value":360},{"type":43,"tag":67,"props":364,"children":365},{},[366,371,389,394],{"type":43,"tag":99,"props":367,"children":368},{},[369],{"type":49,"value":370},"Geospatial (ST)",{"type":43,"tag":99,"props":372,"children":373},{},[374,380,381,387],{"type":43,"tag":108,"props":375,"children":377},{"className":376},[],[378],{"type":49,"value":379},"ST_Point()",{"type":49,"value":115},{"type":43,"tag":108,"props":382,"children":384},{"className":383},[],[385],{"type":49,"value":386},"ST_Contains()",{"type":49,"value":388},", 80+ funcs",{"type":43,"tag":99,"props":390,"children":391},{},[392],{"type":49,"value":393},"DBR 16.0+",{"type":43,"tag":99,"props":395,"children":396},{},[397],{"type":43,"tag":138,"props":398,"children":399},{"href":360},[400],{"type":49,"value":360},{"type":43,"tag":67,"props":402,"children":403},{},[404,409,427,431],{"type":43,"tag":99,"props":405,"children":406},{},[407],{"type":49,"value":408},"Collations",{"type":43,"tag":99,"props":410,"children":411},{},[412,418,419,425],{"type":43,"tag":108,"props":413,"children":415},{"className":414},[],[416],{"type":49,"value":417},"COLLATE",{"type":49,"value":115},{"type":43,"tag":108,"props":420,"children":422},{"className":421},[],[423],{"type":49,"value":424},"UTF8_LCASE",{"type":49,"value":426},", locale-aware",{"type":43,"tag":99,"props":428,"children":429},{},[430],{"type":49,"value":318},{"type":43,"tag":99,"props":432,"children":433},{},[434],{"type":43,"tag":138,"props":435,"children":436},{"href":360},[437],{"type":49,"value":360},{"type":43,"tag":67,"props":439,"children":440},{},[441,446,464,469],{"type":43,"tag":99,"props":442,"children":443},{},[444],{"type":49,"value":445},"AI Functions",{"type":43,"tag":99,"props":447,"children":448},{},[449,455,456,462],{"type":43,"tag":108,"props":450,"children":452},{"className":451},[],[453],{"type":49,"value":454},"ai_query()",{"type":49,"value":115},{"type":43,"tag":108,"props":457,"children":459},{"className":458},[],[460],{"type":49,"value":461},"ai_classify()",{"type":49,"value":463},", 11+ funcs",{"type":43,"tag":99,"props":465,"children":466},{},[467],{"type":49,"value":468},"DBR 15.1+",{"type":43,"tag":99,"props":470,"children":471},{},[472],{"type":43,"tag":138,"props":473,"children":475},{"href":474},"references\u002Fai-functions.md",[476],{"type":49,"value":474},{"type":43,"tag":67,"props":478,"children":479},{},[480,485,494,498],{"type":43,"tag":99,"props":481,"children":482},{},[483],{"type":49,"value":484},"http_request",{"type":43,"tag":99,"props":486,"children":487},{},[488],{"type":43,"tag":108,"props":489,"children":491},{"className":490},[],[492],{"type":49,"value":493},"http_request(conn, ...)",{"type":43,"tag":99,"props":495,"children":496},{},[497],{"type":49,"value":257},{"type":43,"tag":99,"props":499,"children":500},{},[501],{"type":43,"tag":138,"props":502,"children":503},{"href":474},[504],{"type":49,"value":474},{"type":43,"tag":67,"props":506,"children":507},{},[508,513,522,526],{"type":43,"tag":99,"props":509,"children":510},{},[511],{"type":49,"value":512},"remote_query",{"type":43,"tag":99,"props":514,"children":515},{},[516],{"type":43,"tag":108,"props":517,"children":519},{"className":518},[],[520],{"type":49,"value":521},"SELECT * FROM remote_query(...)",{"type":43,"tag":99,"props":523,"children":524},{},[525],{"type":49,"value":257},{"type":43,"tag":99,"props":527,"children":528},{},[529],{"type":43,"tag":138,"props":530,"children":531},{"href":474},[532],{"type":49,"value":474},{"type":43,"tag":67,"props":534,"children":535},{},[536,541,550,554],{"type":43,"tag":99,"props":537,"children":538},{},[539],{"type":49,"value":540},"read_files",{"type":43,"tag":99,"props":542,"children":543},{},[544],{"type":43,"tag":108,"props":545,"children":547},{"className":546},[],[548],{"type":49,"value":549},"SELECT * FROM read_files(...)",{"type":43,"tag":99,"props":551,"children":552},{},[553],{"type":49,"value":287},{"type":43,"tag":99,"props":555,"children":556},{},[557],{"type":43,"tag":138,"props":558,"children":559},{"href":474},[560],{"type":49,"value":474},{"type":43,"tag":67,"props":562,"children":563},{},[564,569,574,578],{"type":43,"tag":99,"props":565,"children":566},{},[567],{"type":49,"value":568},"Data Modeling",{"type":43,"tag":99,"props":570,"children":571},{},[572],{"type":49,"value":573},"Star schema, Liquid Clustering",{"type":43,"tag":99,"props":575,"children":576},{},[577],{"type":49,"value":287},{"type":43,"tag":99,"props":579,"children":580},{},[581],{"type":43,"tag":138,"props":582,"children":584},{"href":583},"references\u002Fbest-practices.md",[585],{"type":49,"value":583},{"type":43,"tag":587,"props":588,"children":589},"hr",{},[],{"type":43,"tag":52,"props":591,"children":593},{"id":592},"common-patterns",[594],{"type":49,"value":595},"Common Patterns",{"type":43,"tag":597,"props":598,"children":600},"h3",{"id":599},"sql-scripting-procedural-etl",[601],{"type":49,"value":602},"SQL Scripting - Procedural ETL",{"type":43,"tag":604,"props":605,"children":609},"pre",{"className":606,"code":607,"language":22,"meta":608,"style":608},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","BEGIN\n  DECLARE v_count INT;\n  DECLARE v_status STRING DEFAULT 'pending';\n\n  SET v_count = (SELECT COUNT(*) FROM catalog.schema.raw_orders WHERE status = 'new');\n\n  IF v_count > 0 THEN\n    INSERT INTO catalog.schema.processed_orders\n    SELECT *, current_timestamp() AS processed_at\n    FROM catalog.schema.raw_orders\n    WHERE status = 'new';\n\n    SET v_status = 'completed';\n  ELSE\n    SET v_status = 'skipped';\n  END IF;\n\n  SELECT v_status AS result, v_count AS rows_processed;\nEND\n","",[610],{"type":43,"tag":108,"props":611,"children":612},{"__ignoreMap":608},[613,624,633,642,652,661,669,678,687,696,705,714,722,731,740,749,758,766,775],{"type":43,"tag":614,"props":615,"children":618},"span",{"class":616,"line":617},"line",1,[619],{"type":43,"tag":614,"props":620,"children":621},{},[622],{"type":49,"value":623},"BEGIN\n",{"type":43,"tag":614,"props":625,"children":627},{"class":616,"line":626},2,[628],{"type":43,"tag":614,"props":629,"children":630},{},[631],{"type":49,"value":632},"  DECLARE v_count INT;\n",{"type":43,"tag":614,"props":634,"children":636},{"class":616,"line":635},3,[637],{"type":43,"tag":614,"props":638,"children":639},{},[640],{"type":49,"value":641},"  DECLARE v_status STRING DEFAULT 'pending';\n",{"type":43,"tag":614,"props":643,"children":645},{"class":616,"line":644},4,[646],{"type":43,"tag":614,"props":647,"children":649},{"emptyLinePlaceholder":648},true,[650],{"type":49,"value":651},"\n",{"type":43,"tag":614,"props":653,"children":655},{"class":616,"line":654},5,[656],{"type":43,"tag":614,"props":657,"children":658},{},[659],{"type":49,"value":660},"  SET v_count = (SELECT COUNT(*) FROM catalog.schema.raw_orders WHERE status = 'new');\n",{"type":43,"tag":614,"props":662,"children":664},{"class":616,"line":663},6,[665],{"type":43,"tag":614,"props":666,"children":667},{"emptyLinePlaceholder":648},[668],{"type":49,"value":651},{"type":43,"tag":614,"props":670,"children":672},{"class":616,"line":671},7,[673],{"type":43,"tag":614,"props":674,"children":675},{},[676],{"type":49,"value":677},"  IF v_count > 0 THEN\n",{"type":43,"tag":614,"props":679,"children":681},{"class":616,"line":680},8,[682],{"type":43,"tag":614,"props":683,"children":684},{},[685],{"type":49,"value":686},"    INSERT INTO catalog.schema.processed_orders\n",{"type":43,"tag":614,"props":688,"children":690},{"class":616,"line":689},9,[691],{"type":43,"tag":614,"props":692,"children":693},{},[694],{"type":49,"value":695},"    SELECT *, current_timestamp() AS processed_at\n",{"type":43,"tag":614,"props":697,"children":699},{"class":616,"line":698},10,[700],{"type":43,"tag":614,"props":701,"children":702},{},[703],{"type":49,"value":704},"    FROM catalog.schema.raw_orders\n",{"type":43,"tag":614,"props":706,"children":708},{"class":616,"line":707},11,[709],{"type":43,"tag":614,"props":710,"children":711},{},[712],{"type":49,"value":713},"    WHERE status = 'new';\n",{"type":43,"tag":614,"props":715,"children":717},{"class":616,"line":716},12,[718],{"type":43,"tag":614,"props":719,"children":720},{"emptyLinePlaceholder":648},[721],{"type":49,"value":651},{"type":43,"tag":614,"props":723,"children":725},{"class":616,"line":724},13,[726],{"type":43,"tag":614,"props":727,"children":728},{},[729],{"type":49,"value":730},"    SET v_status = 'completed';\n",{"type":43,"tag":614,"props":732,"children":734},{"class":616,"line":733},14,[735],{"type":43,"tag":614,"props":736,"children":737},{},[738],{"type":49,"value":739},"  ELSE\n",{"type":43,"tag":614,"props":741,"children":743},{"class":616,"line":742},15,[744],{"type":43,"tag":614,"props":745,"children":746},{},[747],{"type":49,"value":748},"    SET v_status = 'skipped';\n",{"type":43,"tag":614,"props":750,"children":752},{"class":616,"line":751},16,[753],{"type":43,"tag":614,"props":754,"children":755},{},[756],{"type":49,"value":757},"  END IF;\n",{"type":43,"tag":614,"props":759,"children":761},{"class":616,"line":760},17,[762],{"type":43,"tag":614,"props":763,"children":764},{"emptyLinePlaceholder":648},[765],{"type":49,"value":651},{"type":43,"tag":614,"props":767,"children":769},{"class":616,"line":768},18,[770],{"type":43,"tag":614,"props":771,"children":772},{},[773],{"type":49,"value":774},"  SELECT v_status AS result, v_count AS rows_processed;\n",{"type":43,"tag":614,"props":776,"children":778},{"class":616,"line":777},19,[779],{"type":43,"tag":614,"props":780,"children":781},{},[782],{"type":49,"value":783},"END\n",{"type":43,"tag":597,"props":785,"children":787},{"id":786},"stored-procedure-with-error-handling",[788],{"type":49,"value":789},"Stored Procedure with Error Handling",{"type":43,"tag":604,"props":791,"children":793},{"className":606,"code":792,"language":22,"meta":608,"style":608},"CREATE OR REPLACE PROCEDURE catalog.schema.upsert_customers(\n  IN p_source STRING,\n  OUT p_rows_affected INT\n)\nLANGUAGE SQL\nSQL SECURITY INVOKER\nBEGIN\n  DECLARE EXIT HANDLER FOR SQLEXCEPTION\n  BEGIN\n    SET p_rows_affected = -1;\n    SIGNAL SQLSTATE '45000'\n      SET MESSAGE_TEXT = concat('Upsert failed for source: ', p_source);\n  END;\n\n  MERGE INTO catalog.schema.dim_customer AS t\n  USING (SELECT * FROM identifier(p_source)) AS s\n  ON t.customer_id = s.customer_id\n  WHEN MATCHED THEN UPDATE SET *\n  WHEN NOT MATCHED THEN INSERT *;\n\n  SET p_rows_affected = (SELECT COUNT(*) FROM identifier(p_source));\nEND;\n\n-- Invoke:\nCALL catalog.schema.upsert_customers('catalog.schema.staging_customers', ?);\n",[794],{"type":43,"tag":108,"props":795,"children":796},{"__ignoreMap":608},[797,805,813,821,829,837,845,852,860,868,876,884,892,900,907,915,923,931,939,947,955,964,973,981,990],{"type":43,"tag":614,"props":798,"children":799},{"class":616,"line":617},[800],{"type":43,"tag":614,"props":801,"children":802},{},[803],{"type":49,"value":804},"CREATE OR REPLACE PROCEDURE catalog.schema.upsert_customers(\n",{"type":43,"tag":614,"props":806,"children":807},{"class":616,"line":626},[808],{"type":43,"tag":614,"props":809,"children":810},{},[811],{"type":49,"value":812},"  IN p_source STRING,\n",{"type":43,"tag":614,"props":814,"children":815},{"class":616,"line":635},[816],{"type":43,"tag":614,"props":817,"children":818},{},[819],{"type":49,"value":820},"  OUT p_rows_affected INT\n",{"type":43,"tag":614,"props":822,"children":823},{"class":616,"line":644},[824],{"type":43,"tag":614,"props":825,"children":826},{},[827],{"type":49,"value":828},")\n",{"type":43,"tag":614,"props":830,"children":831},{"class":616,"line":654},[832],{"type":43,"tag":614,"props":833,"children":834},{},[835],{"type":49,"value":836},"LANGUAGE SQL\n",{"type":43,"tag":614,"props":838,"children":839},{"class":616,"line":663},[840],{"type":43,"tag":614,"props":841,"children":842},{},[843],{"type":49,"value":844},"SQL SECURITY INVOKER\n",{"type":43,"tag":614,"props":846,"children":847},{"class":616,"line":671},[848],{"type":43,"tag":614,"props":849,"children":850},{},[851],{"type":49,"value":623},{"type":43,"tag":614,"props":853,"children":854},{"class":616,"line":680},[855],{"type":43,"tag":614,"props":856,"children":857},{},[858],{"type":49,"value":859},"  DECLARE EXIT HANDLER FOR SQLEXCEPTION\n",{"type":43,"tag":614,"props":861,"children":862},{"class":616,"line":689},[863],{"type":43,"tag":614,"props":864,"children":865},{},[866],{"type":49,"value":867},"  BEGIN\n",{"type":43,"tag":614,"props":869,"children":870},{"class":616,"line":698},[871],{"type":43,"tag":614,"props":872,"children":873},{},[874],{"type":49,"value":875},"    SET p_rows_affected = -1;\n",{"type":43,"tag":614,"props":877,"children":878},{"class":616,"line":707},[879],{"type":43,"tag":614,"props":880,"children":881},{},[882],{"type":49,"value":883},"    SIGNAL SQLSTATE '45000'\n",{"type":43,"tag":614,"props":885,"children":886},{"class":616,"line":716},[887],{"type":43,"tag":614,"props":888,"children":889},{},[890],{"type":49,"value":891},"      SET MESSAGE_TEXT = concat('Upsert failed for source: ', p_source);\n",{"type":43,"tag":614,"props":893,"children":894},{"class":616,"line":724},[895],{"type":43,"tag":614,"props":896,"children":897},{},[898],{"type":49,"value":899},"  END;\n",{"type":43,"tag":614,"props":901,"children":902},{"class":616,"line":733},[903],{"type":43,"tag":614,"props":904,"children":905},{"emptyLinePlaceholder":648},[906],{"type":49,"value":651},{"type":43,"tag":614,"props":908,"children":909},{"class":616,"line":742},[910],{"type":43,"tag":614,"props":911,"children":912},{},[913],{"type":49,"value":914},"  MERGE INTO catalog.schema.dim_customer AS t\n",{"type":43,"tag":614,"props":916,"children":917},{"class":616,"line":751},[918],{"type":43,"tag":614,"props":919,"children":920},{},[921],{"type":49,"value":922},"  USING (SELECT * FROM identifier(p_source)) AS s\n",{"type":43,"tag":614,"props":924,"children":925},{"class":616,"line":760},[926],{"type":43,"tag":614,"props":927,"children":928},{},[929],{"type":49,"value":930},"  ON t.customer_id = s.customer_id\n",{"type":43,"tag":614,"props":932,"children":933},{"class":616,"line":768},[934],{"type":43,"tag":614,"props":935,"children":936},{},[937],{"type":49,"value":938},"  WHEN MATCHED THEN UPDATE SET *\n",{"type":43,"tag":614,"props":940,"children":941},{"class":616,"line":777},[942],{"type":43,"tag":614,"props":943,"children":944},{},[945],{"type":49,"value":946},"  WHEN NOT MATCHED THEN INSERT *;\n",{"type":43,"tag":614,"props":948,"children":950},{"class":616,"line":949},20,[951],{"type":43,"tag":614,"props":952,"children":953},{"emptyLinePlaceholder":648},[954],{"type":49,"value":651},{"type":43,"tag":614,"props":956,"children":958},{"class":616,"line":957},21,[959],{"type":43,"tag":614,"props":960,"children":961},{},[962],{"type":49,"value":963},"  SET p_rows_affected = (SELECT COUNT(*) FROM identifier(p_source));\n",{"type":43,"tag":614,"props":965,"children":967},{"class":616,"line":966},22,[968],{"type":43,"tag":614,"props":969,"children":970},{},[971],{"type":49,"value":972},"END;\n",{"type":43,"tag":614,"props":974,"children":976},{"class":616,"line":975},23,[977],{"type":43,"tag":614,"props":978,"children":979},{"emptyLinePlaceholder":648},[980],{"type":49,"value":651},{"type":43,"tag":614,"props":982,"children":984},{"class":616,"line":983},24,[985],{"type":43,"tag":614,"props":986,"children":987},{},[988],{"type":49,"value":989},"-- Invoke:\n",{"type":43,"tag":614,"props":991,"children":993},{"class":616,"line":992},25,[994],{"type":43,"tag":614,"props":995,"children":996},{},[997],{"type":49,"value":998},"CALL catalog.schema.upsert_customers('catalog.schema.staging_customers', ?);\n",{"type":43,"tag":597,"props":1000,"children":1002},{"id":1001},"materialized-view-with-scheduled-refresh",[1003],{"type":49,"value":1004},"Materialized View with Scheduled Refresh",{"type":43,"tag":604,"props":1006,"children":1008},{"className":606,"code":1007,"language":22,"meta":608,"style":608},"CREATE OR REPLACE MATERIALIZED VIEW catalog.schema.daily_revenue\n  CLUSTER BY (order_date)\n  SCHEDULE EVERY 1 HOUR\n  COMMENT 'Hourly-refreshed daily revenue by region'\nAS SELECT\n    order_date,\n    region,\n    SUM(amount) AS total_revenue,\n    COUNT(DISTINCT customer_id) AS unique_customers\nFROM catalog.schema.fact_orders\nJOIN catalog.schema.dim_store USING (store_id)\nGROUP BY order_date, region;\n",[1009],{"type":43,"tag":108,"props":1010,"children":1011},{"__ignoreMap":608},[1012,1020,1028,1036,1044,1052,1060,1068,1076,1084,1092,1100],{"type":43,"tag":614,"props":1013,"children":1014},{"class":616,"line":617},[1015],{"type":43,"tag":614,"props":1016,"children":1017},{},[1018],{"type":49,"value":1019},"CREATE OR REPLACE MATERIALIZED VIEW catalog.schema.daily_revenue\n",{"type":43,"tag":614,"props":1021,"children":1022},{"class":616,"line":626},[1023],{"type":43,"tag":614,"props":1024,"children":1025},{},[1026],{"type":49,"value":1027},"  CLUSTER BY (order_date)\n",{"type":43,"tag":614,"props":1029,"children":1030},{"class":616,"line":635},[1031],{"type":43,"tag":614,"props":1032,"children":1033},{},[1034],{"type":49,"value":1035},"  SCHEDULE EVERY 1 HOUR\n",{"type":43,"tag":614,"props":1037,"children":1038},{"class":616,"line":644},[1039],{"type":43,"tag":614,"props":1040,"children":1041},{},[1042],{"type":49,"value":1043},"  COMMENT 'Hourly-refreshed daily revenue by region'\n",{"type":43,"tag":614,"props":1045,"children":1046},{"class":616,"line":654},[1047],{"type":43,"tag":614,"props":1048,"children":1049},{},[1050],{"type":49,"value":1051},"AS SELECT\n",{"type":43,"tag":614,"props":1053,"children":1054},{"class":616,"line":663},[1055],{"type":43,"tag":614,"props":1056,"children":1057},{},[1058],{"type":49,"value":1059},"    order_date,\n",{"type":43,"tag":614,"props":1061,"children":1062},{"class":616,"line":671},[1063],{"type":43,"tag":614,"props":1064,"children":1065},{},[1066],{"type":49,"value":1067},"    region,\n",{"type":43,"tag":614,"props":1069,"children":1070},{"class":616,"line":680},[1071],{"type":43,"tag":614,"props":1072,"children":1073},{},[1074],{"type":49,"value":1075},"    SUM(amount) AS total_revenue,\n",{"type":43,"tag":614,"props":1077,"children":1078},{"class":616,"line":689},[1079],{"type":43,"tag":614,"props":1080,"children":1081},{},[1082],{"type":49,"value":1083},"    COUNT(DISTINCT customer_id) AS unique_customers\n",{"type":43,"tag":614,"props":1085,"children":1086},{"class":616,"line":698},[1087],{"type":43,"tag":614,"props":1088,"children":1089},{},[1090],{"type":49,"value":1091},"FROM catalog.schema.fact_orders\n",{"type":43,"tag":614,"props":1093,"children":1094},{"class":616,"line":707},[1095],{"type":43,"tag":614,"props":1096,"children":1097},{},[1098],{"type":49,"value":1099},"JOIN catalog.schema.dim_store USING (store_id)\n",{"type":43,"tag":614,"props":1101,"children":1102},{"class":616,"line":716},[1103],{"type":43,"tag":614,"props":1104,"children":1105},{},[1106],{"type":49,"value":1107},"GROUP BY order_date, region;\n",{"type":43,"tag":597,"props":1109,"children":1111},{"id":1110},"pipe-syntax-readable-transformations",[1112],{"type":49,"value":1113},"Pipe Syntax - Readable Transformations",{"type":43,"tag":604,"props":1115,"children":1117},{"className":606,"code":1116,"language":22,"meta":608,"style":608},"-- Traditional SQL rewritten with pipe syntax\nFROM catalog.schema.fact_orders\n  |> WHERE order_date >= current_date() - INTERVAL 30 DAYS\n  |> AGGREGATE SUM(amount) AS total, COUNT(*) AS cnt GROUP BY region, product_category\n  |> WHERE total > 10000\n  |> ORDER BY total DESC\n  |> LIMIT 20;\n",[1118],{"type":43,"tag":108,"props":1119,"children":1120},{"__ignoreMap":608},[1121,1129,1136,1144,1152,1160,1168],{"type":43,"tag":614,"props":1122,"children":1123},{"class":616,"line":617},[1124],{"type":43,"tag":614,"props":1125,"children":1126},{},[1127],{"type":49,"value":1128},"-- Traditional SQL rewritten with pipe syntax\n",{"type":43,"tag":614,"props":1130,"children":1131},{"class":616,"line":626},[1132],{"type":43,"tag":614,"props":1133,"children":1134},{},[1135],{"type":49,"value":1091},{"type":43,"tag":614,"props":1137,"children":1138},{"class":616,"line":635},[1139],{"type":43,"tag":614,"props":1140,"children":1141},{},[1142],{"type":49,"value":1143},"  |> WHERE order_date >= current_date() - INTERVAL 30 DAYS\n",{"type":43,"tag":614,"props":1145,"children":1146},{"class":616,"line":644},[1147],{"type":43,"tag":614,"props":1148,"children":1149},{},[1150],{"type":49,"value":1151},"  |> AGGREGATE SUM(amount) AS total, COUNT(*) AS cnt GROUP BY region, product_category\n",{"type":43,"tag":614,"props":1153,"children":1154},{"class":616,"line":654},[1155],{"type":43,"tag":614,"props":1156,"children":1157},{},[1158],{"type":49,"value":1159},"  |> WHERE total > 10000\n",{"type":43,"tag":614,"props":1161,"children":1162},{"class":616,"line":663},[1163],{"type":43,"tag":614,"props":1164,"children":1165},{},[1166],{"type":49,"value":1167},"  |> ORDER BY total DESC\n",{"type":43,"tag":614,"props":1169,"children":1170},{"class":616,"line":671},[1171],{"type":43,"tag":614,"props":1172,"children":1173},{},[1174],{"type":49,"value":1175},"  |> LIMIT 20;\n",{"type":43,"tag":597,"props":1177,"children":1179},{"id":1178},"ai-functions-enrich-data-with-llms",[1180],{"type":49,"value":1181},"AI Functions - Enrich Data with LLMs",{"type":43,"tag":604,"props":1183,"children":1185},{"className":606,"code":1184,"language":22,"meta":608,"style":608},"-- Classify support tickets\nSELECT\n  ticket_id,\n  description,\n  ai_classify(description, ARRAY('billing', 'technical', 'account', 'feature_request')) AS category,\n  ai_analyze_sentiment(description) AS sentiment\nFROM catalog.schema.support_tickets\nLIMIT 100;\n\n-- Extract entities from text\nSELECT\n  doc_id,\n  ai_extract(content, ARRAY('person_name', 'company', 'dollar_amount')) AS entities\nFROM catalog.schema.contracts;\n\n-- General-purpose AI query with structured output\nSELECT ai_query(\n  'databricks-meta-llama-3-3-70b-instruct',\n  concat('Summarize this customer feedback in JSON with keys: topic, sentiment, action_items. Feedback: ', feedback),\n  returnType => 'STRUCT\u003Ctopic STRING, sentiment STRING, action_items ARRAY\u003CSTRING>>'\n) AS analysis\nFROM catalog.schema.customer_feedback\nLIMIT 50;\n",[1186],{"type":43,"tag":108,"props":1187,"children":1188},{"__ignoreMap":608},[1189,1197,1205,1213,1221,1229,1237,1245,1253,1260,1268,1275,1283,1291,1299,1306,1314,1322,1330,1338,1346,1354,1362],{"type":43,"tag":614,"props":1190,"children":1191},{"class":616,"line":617},[1192],{"type":43,"tag":614,"props":1193,"children":1194},{},[1195],{"type":49,"value":1196},"-- Classify support tickets\n",{"type":43,"tag":614,"props":1198,"children":1199},{"class":616,"line":626},[1200],{"type":43,"tag":614,"props":1201,"children":1202},{},[1203],{"type":49,"value":1204},"SELECT\n",{"type":43,"tag":614,"props":1206,"children":1207},{"class":616,"line":635},[1208],{"type":43,"tag":614,"props":1209,"children":1210},{},[1211],{"type":49,"value":1212},"  ticket_id,\n",{"type":43,"tag":614,"props":1214,"children":1215},{"class":616,"line":644},[1216],{"type":43,"tag":614,"props":1217,"children":1218},{},[1219],{"type":49,"value":1220},"  description,\n",{"type":43,"tag":614,"props":1222,"children":1223},{"class":616,"line":654},[1224],{"type":43,"tag":614,"props":1225,"children":1226},{},[1227],{"type":49,"value":1228},"  ai_classify(description, ARRAY('billing', 'technical', 'account', 'feature_request')) AS category,\n",{"type":43,"tag":614,"props":1230,"children":1231},{"class":616,"line":663},[1232],{"type":43,"tag":614,"props":1233,"children":1234},{},[1235],{"type":49,"value":1236},"  ai_analyze_sentiment(description) AS sentiment\n",{"type":43,"tag":614,"props":1238,"children":1239},{"class":616,"line":671},[1240],{"type":43,"tag":614,"props":1241,"children":1242},{},[1243],{"type":49,"value":1244},"FROM catalog.schema.support_tickets\n",{"type":43,"tag":614,"props":1246,"children":1247},{"class":616,"line":680},[1248],{"type":43,"tag":614,"props":1249,"children":1250},{},[1251],{"type":49,"value":1252},"LIMIT 100;\n",{"type":43,"tag":614,"props":1254,"children":1255},{"class":616,"line":689},[1256],{"type":43,"tag":614,"props":1257,"children":1258},{"emptyLinePlaceholder":648},[1259],{"type":49,"value":651},{"type":43,"tag":614,"props":1261,"children":1262},{"class":616,"line":698},[1263],{"type":43,"tag":614,"props":1264,"children":1265},{},[1266],{"type":49,"value":1267},"-- Extract entities from text\n",{"type":43,"tag":614,"props":1269,"children":1270},{"class":616,"line":707},[1271],{"type":43,"tag":614,"props":1272,"children":1273},{},[1274],{"type":49,"value":1204},{"type":43,"tag":614,"props":1276,"children":1277},{"class":616,"line":716},[1278],{"type":43,"tag":614,"props":1279,"children":1280},{},[1281],{"type":49,"value":1282},"  doc_id,\n",{"type":43,"tag":614,"props":1284,"children":1285},{"class":616,"line":724},[1286],{"type":43,"tag":614,"props":1287,"children":1288},{},[1289],{"type":49,"value":1290},"  ai_extract(content, ARRAY('person_name', 'company', 'dollar_amount')) AS entities\n",{"type":43,"tag":614,"props":1292,"children":1293},{"class":616,"line":733},[1294],{"type":43,"tag":614,"props":1295,"children":1296},{},[1297],{"type":49,"value":1298},"FROM catalog.schema.contracts;\n",{"type":43,"tag":614,"props":1300,"children":1301},{"class":616,"line":742},[1302],{"type":43,"tag":614,"props":1303,"children":1304},{"emptyLinePlaceholder":648},[1305],{"type":49,"value":651},{"type":43,"tag":614,"props":1307,"children":1308},{"class":616,"line":751},[1309],{"type":43,"tag":614,"props":1310,"children":1311},{},[1312],{"type":49,"value":1313},"-- General-purpose AI query with structured output\n",{"type":43,"tag":614,"props":1315,"children":1316},{"class":616,"line":760},[1317],{"type":43,"tag":614,"props":1318,"children":1319},{},[1320],{"type":49,"value":1321},"SELECT ai_query(\n",{"type":43,"tag":614,"props":1323,"children":1324},{"class":616,"line":768},[1325],{"type":43,"tag":614,"props":1326,"children":1327},{},[1328],{"type":49,"value":1329},"  'databricks-meta-llama-3-3-70b-instruct',\n",{"type":43,"tag":614,"props":1331,"children":1332},{"class":616,"line":777},[1333],{"type":43,"tag":614,"props":1334,"children":1335},{},[1336],{"type":49,"value":1337},"  concat('Summarize this customer feedback in JSON with keys: topic, sentiment, action_items. Feedback: ', feedback),\n",{"type":43,"tag":614,"props":1339,"children":1340},{"class":616,"line":949},[1341],{"type":43,"tag":614,"props":1342,"children":1343},{},[1344],{"type":49,"value":1345},"  returnType => 'STRUCT\u003Ctopic STRING, sentiment STRING, action_items ARRAY\u003CSTRING>>'\n",{"type":43,"tag":614,"props":1347,"children":1348},{"class":616,"line":957},[1349],{"type":43,"tag":614,"props":1350,"children":1351},{},[1352],{"type":49,"value":1353},") AS analysis\n",{"type":43,"tag":614,"props":1355,"children":1356},{"class":616,"line":966},[1357],{"type":43,"tag":614,"props":1358,"children":1359},{},[1360],{"type":49,"value":1361},"FROM catalog.schema.customer_feedback\n",{"type":43,"tag":614,"props":1363,"children":1364},{"class":616,"line":975},[1365],{"type":43,"tag":614,"props":1366,"children":1367},{},[1368],{"type":49,"value":1369},"LIMIT 50;\n",{"type":43,"tag":597,"props":1371,"children":1373},{"id":1372},"geospatial-proximity-search-with-h3",[1374],{"type":49,"value":1375},"Geospatial - Proximity Search with H3",{"type":43,"tag":604,"props":1377,"children":1379},{"className":606,"code":1378,"language":22,"meta":608,"style":608},"-- Find stores within 5km of each customer using H3 indexing\nWITH customer_h3 AS (\n  SELECT *, h3_longlatash3(longitude, latitude, 7) AS h3_cell\n  FROM catalog.schema.customers\n),\nstore_h3 AS (\n  SELECT *, h3_longlatash3(longitude, latitude, 7) AS h3_cell\n  FROM catalog.schema.stores\n)\nSELECT\n  c.customer_id,\n  s.store_id,\n  ST_Distance(\n    ST_Point(c.longitude, c.latitude),\n    ST_Point(s.longitude, s.latitude)\n  ) AS distance_m\nFROM customer_h3 c\nJOIN store_h3 s ON h3_ischildof(c.h3_cell, h3_toparent(s.h3_cell, 5))\nWHERE ST_Distance(\n  ST_Point(c.longitude, c.latitude),\n  ST_Point(s.longitude, s.latitude)\n) \u003C 5000;\n",[1380],{"type":43,"tag":108,"props":1381,"children":1382},{"__ignoreMap":608},[1383,1391,1399,1407,1415,1423,1431,1438,1446,1453,1460,1468,1476,1484,1492,1500,1508,1516,1524,1532,1540,1548],{"type":43,"tag":614,"props":1384,"children":1385},{"class":616,"line":617},[1386],{"type":43,"tag":614,"props":1387,"children":1388},{},[1389],{"type":49,"value":1390},"-- Find stores within 5km of each customer using H3 indexing\n",{"type":43,"tag":614,"props":1392,"children":1393},{"class":616,"line":626},[1394],{"type":43,"tag":614,"props":1395,"children":1396},{},[1397],{"type":49,"value":1398},"WITH customer_h3 AS (\n",{"type":43,"tag":614,"props":1400,"children":1401},{"class":616,"line":635},[1402],{"type":43,"tag":614,"props":1403,"children":1404},{},[1405],{"type":49,"value":1406},"  SELECT *, h3_longlatash3(longitude, latitude, 7) AS h3_cell\n",{"type":43,"tag":614,"props":1408,"children":1409},{"class":616,"line":644},[1410],{"type":43,"tag":614,"props":1411,"children":1412},{},[1413],{"type":49,"value":1414},"  FROM catalog.schema.customers\n",{"type":43,"tag":614,"props":1416,"children":1417},{"class":616,"line":654},[1418],{"type":43,"tag":614,"props":1419,"children":1420},{},[1421],{"type":49,"value":1422},"),\n",{"type":43,"tag":614,"props":1424,"children":1425},{"class":616,"line":663},[1426],{"type":43,"tag":614,"props":1427,"children":1428},{},[1429],{"type":49,"value":1430},"store_h3 AS (\n",{"type":43,"tag":614,"props":1432,"children":1433},{"class":616,"line":671},[1434],{"type":43,"tag":614,"props":1435,"children":1436},{},[1437],{"type":49,"value":1406},{"type":43,"tag":614,"props":1439,"children":1440},{"class":616,"line":680},[1441],{"type":43,"tag":614,"props":1442,"children":1443},{},[1444],{"type":49,"value":1445},"  FROM catalog.schema.stores\n",{"type":43,"tag":614,"props":1447,"children":1448},{"class":616,"line":689},[1449],{"type":43,"tag":614,"props":1450,"children":1451},{},[1452],{"type":49,"value":828},{"type":43,"tag":614,"props":1454,"children":1455},{"class":616,"line":698},[1456],{"type":43,"tag":614,"props":1457,"children":1458},{},[1459],{"type":49,"value":1204},{"type":43,"tag":614,"props":1461,"children":1462},{"class":616,"line":707},[1463],{"type":43,"tag":614,"props":1464,"children":1465},{},[1466],{"type":49,"value":1467},"  c.customer_id,\n",{"type":43,"tag":614,"props":1469,"children":1470},{"class":616,"line":716},[1471],{"type":43,"tag":614,"props":1472,"children":1473},{},[1474],{"type":49,"value":1475},"  s.store_id,\n",{"type":43,"tag":614,"props":1477,"children":1478},{"class":616,"line":724},[1479],{"type":43,"tag":614,"props":1480,"children":1481},{},[1482],{"type":49,"value":1483},"  ST_Distance(\n",{"type":43,"tag":614,"props":1485,"children":1486},{"class":616,"line":733},[1487],{"type":43,"tag":614,"props":1488,"children":1489},{},[1490],{"type":49,"value":1491},"    ST_Point(c.longitude, c.latitude),\n",{"type":43,"tag":614,"props":1493,"children":1494},{"class":616,"line":742},[1495],{"type":43,"tag":614,"props":1496,"children":1497},{},[1498],{"type":49,"value":1499},"    ST_Point(s.longitude, s.latitude)\n",{"type":43,"tag":614,"props":1501,"children":1502},{"class":616,"line":751},[1503],{"type":43,"tag":614,"props":1504,"children":1505},{},[1506],{"type":49,"value":1507},"  ) AS distance_m\n",{"type":43,"tag":614,"props":1509,"children":1510},{"class":616,"line":760},[1511],{"type":43,"tag":614,"props":1512,"children":1513},{},[1514],{"type":49,"value":1515},"FROM customer_h3 c\n",{"type":43,"tag":614,"props":1517,"children":1518},{"class":616,"line":768},[1519],{"type":43,"tag":614,"props":1520,"children":1521},{},[1522],{"type":49,"value":1523},"JOIN store_h3 s ON h3_ischildof(c.h3_cell, h3_toparent(s.h3_cell, 5))\n",{"type":43,"tag":614,"props":1525,"children":1526},{"class":616,"line":777},[1527],{"type":43,"tag":614,"props":1528,"children":1529},{},[1530],{"type":49,"value":1531},"WHERE ST_Distance(\n",{"type":43,"tag":614,"props":1533,"children":1534},{"class":616,"line":949},[1535],{"type":43,"tag":614,"props":1536,"children":1537},{},[1538],{"type":49,"value":1539},"  ST_Point(c.longitude, c.latitude),\n",{"type":43,"tag":614,"props":1541,"children":1542},{"class":616,"line":957},[1543],{"type":43,"tag":614,"props":1544,"children":1545},{},[1546],{"type":49,"value":1547},"  ST_Point(s.longitude, s.latitude)\n",{"type":43,"tag":614,"props":1549,"children":1550},{"class":616,"line":966},[1551],{"type":43,"tag":614,"props":1552,"children":1553},{},[1554],{"type":49,"value":1555},") \u003C 5000;\n",{"type":43,"tag":597,"props":1557,"children":1559},{"id":1558},"collation-case-insensitive-search",[1560],{"type":49,"value":1561},"Collation - Case-Insensitive Search",{"type":43,"tag":604,"props":1563,"children":1565},{"className":606,"code":1564,"language":22,"meta":608,"style":608},"-- Create table with case-insensitive collation\nCREATE TABLE catalog.schema.products (\n  product_id BIGINT GENERATED ALWAYS AS IDENTITY,\n  name STRING COLLATE UTF8_LCASE,\n  category STRING COLLATE UTF8_LCASE,\n  price DECIMAL(10, 2)\n);\n\n-- Queries automatically case-insensitive (no LOWER() needed)\nSELECT * FROM catalog.schema.products\nWHERE name = 'MacBook Pro';  -- matches 'macbook pro', 'MACBOOK PRO', etc.\n",[1566],{"type":43,"tag":108,"props":1567,"children":1568},{"__ignoreMap":608},[1569,1577,1585,1593,1601,1609,1617,1625,1632,1640,1648],{"type":43,"tag":614,"props":1570,"children":1571},{"class":616,"line":617},[1572],{"type":43,"tag":614,"props":1573,"children":1574},{},[1575],{"type":49,"value":1576},"-- Create table with case-insensitive collation\n",{"type":43,"tag":614,"props":1578,"children":1579},{"class":616,"line":626},[1580],{"type":43,"tag":614,"props":1581,"children":1582},{},[1583],{"type":49,"value":1584},"CREATE TABLE catalog.schema.products (\n",{"type":43,"tag":614,"props":1586,"children":1587},{"class":616,"line":635},[1588],{"type":43,"tag":614,"props":1589,"children":1590},{},[1591],{"type":49,"value":1592},"  product_id BIGINT GENERATED ALWAYS AS IDENTITY,\n",{"type":43,"tag":614,"props":1594,"children":1595},{"class":616,"line":644},[1596],{"type":43,"tag":614,"props":1597,"children":1598},{},[1599],{"type":49,"value":1600},"  name STRING COLLATE UTF8_LCASE,\n",{"type":43,"tag":614,"props":1602,"children":1603},{"class":616,"line":654},[1604],{"type":43,"tag":614,"props":1605,"children":1606},{},[1607],{"type":49,"value":1608},"  category STRING COLLATE UTF8_LCASE,\n",{"type":43,"tag":614,"props":1610,"children":1611},{"class":616,"line":663},[1612],{"type":43,"tag":614,"props":1613,"children":1614},{},[1615],{"type":49,"value":1616},"  price DECIMAL(10, 2)\n",{"type":43,"tag":614,"props":1618,"children":1619},{"class":616,"line":671},[1620],{"type":43,"tag":614,"props":1621,"children":1622},{},[1623],{"type":49,"value":1624},");\n",{"type":43,"tag":614,"props":1626,"children":1627},{"class":616,"line":680},[1628],{"type":43,"tag":614,"props":1629,"children":1630},{"emptyLinePlaceholder":648},[1631],{"type":49,"value":651},{"type":43,"tag":614,"props":1633,"children":1634},{"class":616,"line":689},[1635],{"type":43,"tag":614,"props":1636,"children":1637},{},[1638],{"type":49,"value":1639},"-- Queries automatically case-insensitive (no LOWER() needed)\n",{"type":43,"tag":614,"props":1641,"children":1642},{"class":616,"line":698},[1643],{"type":43,"tag":614,"props":1644,"children":1645},{},[1646],{"type":49,"value":1647},"SELECT * FROM catalog.schema.products\n",{"type":43,"tag":614,"props":1649,"children":1650},{"class":616,"line":707},[1651],{"type":43,"tag":614,"props":1652,"children":1653},{},[1654],{"type":49,"value":1655},"WHERE name = 'MacBook Pro';  -- matches 'macbook pro', 'MACBOOK PRO', etc.\n",{"type":43,"tag":597,"props":1657,"children":1659},{"id":1658},"http_request-call-external-apis",[1660],{"type":49,"value":1661},"http_request - Call External APIs",{"type":43,"tag":604,"props":1663,"children":1665},{"className":606,"code":1664,"language":22,"meta":608,"style":608},"-- Set up connection first (one-time)\nCREATE CONNECTION my_api_conn\n  TYPE HTTP\n  OPTIONS (host 'https:\u002F\u002Fapi.example.com', bearer_token secret('scope', 'token'));\n\n-- Call API from SQL\nSELECT\n  order_id,\n  http_request(\n    conn => 'my_api_conn',\n    method => 'POST',\n    path => '\u002Fv1\u002Fvalidate',\n    json => to_json(named_struct('order_id', order_id, 'amount', amount))\n  ).text AS api_response\nFROM catalog.schema.orders\nWHERE needs_validation = true;\n",[1666],{"type":43,"tag":108,"props":1667,"children":1668},{"__ignoreMap":608},[1669,1677,1685,1693,1701,1708,1716,1723,1731,1739,1747,1755,1763,1771,1779,1787],{"type":43,"tag":614,"props":1670,"children":1671},{"class":616,"line":617},[1672],{"type":43,"tag":614,"props":1673,"children":1674},{},[1675],{"type":49,"value":1676},"-- Set up connection first (one-time)\n",{"type":43,"tag":614,"props":1678,"children":1679},{"class":616,"line":626},[1680],{"type":43,"tag":614,"props":1681,"children":1682},{},[1683],{"type":49,"value":1684},"CREATE CONNECTION my_api_conn\n",{"type":43,"tag":614,"props":1686,"children":1687},{"class":616,"line":635},[1688],{"type":43,"tag":614,"props":1689,"children":1690},{},[1691],{"type":49,"value":1692},"  TYPE HTTP\n",{"type":43,"tag":614,"props":1694,"children":1695},{"class":616,"line":644},[1696],{"type":43,"tag":614,"props":1697,"children":1698},{},[1699],{"type":49,"value":1700},"  OPTIONS (host 'https:\u002F\u002Fapi.example.com', bearer_token secret('scope', 'token'));\n",{"type":43,"tag":614,"props":1702,"children":1703},{"class":616,"line":654},[1704],{"type":43,"tag":614,"props":1705,"children":1706},{"emptyLinePlaceholder":648},[1707],{"type":49,"value":651},{"type":43,"tag":614,"props":1709,"children":1710},{"class":616,"line":663},[1711],{"type":43,"tag":614,"props":1712,"children":1713},{},[1714],{"type":49,"value":1715},"-- Call API from SQL\n",{"type":43,"tag":614,"props":1717,"children":1718},{"class":616,"line":671},[1719],{"type":43,"tag":614,"props":1720,"children":1721},{},[1722],{"type":49,"value":1204},{"type":43,"tag":614,"props":1724,"children":1725},{"class":616,"line":680},[1726],{"type":43,"tag":614,"props":1727,"children":1728},{},[1729],{"type":49,"value":1730},"  order_id,\n",{"type":43,"tag":614,"props":1732,"children":1733},{"class":616,"line":689},[1734],{"type":43,"tag":614,"props":1735,"children":1736},{},[1737],{"type":49,"value":1738},"  http_request(\n",{"type":43,"tag":614,"props":1740,"children":1741},{"class":616,"line":698},[1742],{"type":43,"tag":614,"props":1743,"children":1744},{},[1745],{"type":49,"value":1746},"    conn => 'my_api_conn',\n",{"type":43,"tag":614,"props":1748,"children":1749},{"class":616,"line":707},[1750],{"type":43,"tag":614,"props":1751,"children":1752},{},[1753],{"type":49,"value":1754},"    method => 'POST',\n",{"type":43,"tag":614,"props":1756,"children":1757},{"class":616,"line":716},[1758],{"type":43,"tag":614,"props":1759,"children":1760},{},[1761],{"type":49,"value":1762},"    path => '\u002Fv1\u002Fvalidate',\n",{"type":43,"tag":614,"props":1764,"children":1765},{"class":616,"line":724},[1766],{"type":43,"tag":614,"props":1767,"children":1768},{},[1769],{"type":49,"value":1770},"    json => to_json(named_struct('order_id', order_id, 'amount', amount))\n",{"type":43,"tag":614,"props":1772,"children":1773},{"class":616,"line":733},[1774],{"type":43,"tag":614,"props":1775,"children":1776},{},[1777],{"type":49,"value":1778},"  ).text AS api_response\n",{"type":43,"tag":614,"props":1780,"children":1781},{"class":616,"line":742},[1782],{"type":43,"tag":614,"props":1783,"children":1784},{},[1785],{"type":49,"value":1786},"FROM catalog.schema.orders\n",{"type":43,"tag":614,"props":1788,"children":1789},{"class":616,"line":751},[1790],{"type":43,"tag":614,"props":1791,"children":1792},{},[1793],{"type":49,"value":1794},"WHERE needs_validation = true;\n",{"type":43,"tag":597,"props":1796,"children":1798},{"id":1797},"read_files-ingest-raw-files",[1799],{"type":49,"value":1800},"read_files - Ingest Raw Files",{"type":43,"tag":604,"props":1802,"children":1804},{"className":606,"code":1803,"language":22,"meta":608,"style":608},"-- Read JSON files from a Volume with schema hints\nSELECT *\nFROM read_files(\n  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fevents\u002F',\n  format => 'json',\n  schemaHints => 'event_id STRING, timestamp TIMESTAMP, payload MAP\u003CSTRING, STRING>',\n  pathGlobFilter => '*.json',\n  recursiveFileLookup => true\n);\n\n-- Read CSV with options\nSELECT *\nFROM read_files(\n  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fsales\u002F',\n  format => 'csv',\n  header => true,\n  delimiter => '|',\n  dateFormat => 'yyyy-MM-dd',\n  schema => 'sale_id INT, sale_date DATE, amount DECIMAL(10,2), store STRING'\n);\n",[1805],{"type":43,"tag":108,"props":1806,"children":1807},{"__ignoreMap":608},[1808,1816,1824,1832,1840,1848,1856,1864,1872,1879,1886,1894,1901,1908,1916,1924,1932,1940,1948,1956],{"type":43,"tag":614,"props":1809,"children":1810},{"class":616,"line":617},[1811],{"type":43,"tag":614,"props":1812,"children":1813},{},[1814],{"type":49,"value":1815},"-- Read JSON files from a Volume with schema hints\n",{"type":43,"tag":614,"props":1817,"children":1818},{"class":616,"line":626},[1819],{"type":43,"tag":614,"props":1820,"children":1821},{},[1822],{"type":49,"value":1823},"SELECT *\n",{"type":43,"tag":614,"props":1825,"children":1826},{"class":616,"line":635},[1827],{"type":43,"tag":614,"props":1828,"children":1829},{},[1830],{"type":49,"value":1831},"FROM read_files(\n",{"type":43,"tag":614,"props":1833,"children":1834},{"class":616,"line":644},[1835],{"type":43,"tag":614,"props":1836,"children":1837},{},[1838],{"type":49,"value":1839},"  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fevents\u002F',\n",{"type":43,"tag":614,"props":1841,"children":1842},{"class":616,"line":654},[1843],{"type":43,"tag":614,"props":1844,"children":1845},{},[1846],{"type":49,"value":1847},"  format => 'json',\n",{"type":43,"tag":614,"props":1849,"children":1850},{"class":616,"line":663},[1851],{"type":43,"tag":614,"props":1852,"children":1853},{},[1854],{"type":49,"value":1855},"  schemaHints => 'event_id STRING, timestamp TIMESTAMP, payload MAP\u003CSTRING, STRING>',\n",{"type":43,"tag":614,"props":1857,"children":1858},{"class":616,"line":671},[1859],{"type":43,"tag":614,"props":1860,"children":1861},{},[1862],{"type":49,"value":1863},"  pathGlobFilter => '*.json',\n",{"type":43,"tag":614,"props":1865,"children":1866},{"class":616,"line":680},[1867],{"type":43,"tag":614,"props":1868,"children":1869},{},[1870],{"type":49,"value":1871},"  recursiveFileLookup => true\n",{"type":43,"tag":614,"props":1873,"children":1874},{"class":616,"line":689},[1875],{"type":43,"tag":614,"props":1876,"children":1877},{},[1878],{"type":49,"value":1624},{"type":43,"tag":614,"props":1880,"children":1881},{"class":616,"line":698},[1882],{"type":43,"tag":614,"props":1883,"children":1884},{"emptyLinePlaceholder":648},[1885],{"type":49,"value":651},{"type":43,"tag":614,"props":1887,"children":1888},{"class":616,"line":707},[1889],{"type":43,"tag":614,"props":1890,"children":1891},{},[1892],{"type":49,"value":1893},"-- Read CSV with options\n",{"type":43,"tag":614,"props":1895,"children":1896},{"class":616,"line":716},[1897],{"type":43,"tag":614,"props":1898,"children":1899},{},[1900],{"type":49,"value":1823},{"type":43,"tag":614,"props":1902,"children":1903},{"class":616,"line":724},[1904],{"type":43,"tag":614,"props":1905,"children":1906},{},[1907],{"type":49,"value":1831},{"type":43,"tag":614,"props":1909,"children":1910},{"class":616,"line":733},[1911],{"type":43,"tag":614,"props":1912,"children":1913},{},[1914],{"type":49,"value":1915},"  '\u002FVolumes\u002Fcatalog\u002Fschema\u002Fraw\u002Fsales\u002F',\n",{"type":43,"tag":614,"props":1917,"children":1918},{"class":616,"line":742},[1919],{"type":43,"tag":614,"props":1920,"children":1921},{},[1922],{"type":49,"value":1923},"  format => 'csv',\n",{"type":43,"tag":614,"props":1925,"children":1926},{"class":616,"line":751},[1927],{"type":43,"tag":614,"props":1928,"children":1929},{},[1930],{"type":49,"value":1931},"  header => true,\n",{"type":43,"tag":614,"props":1933,"children":1934},{"class":616,"line":760},[1935],{"type":43,"tag":614,"props":1936,"children":1937},{},[1938],{"type":49,"value":1939},"  delimiter => '|',\n",{"type":43,"tag":614,"props":1941,"children":1942},{"class":616,"line":768},[1943],{"type":43,"tag":614,"props":1944,"children":1945},{},[1946],{"type":49,"value":1947},"  dateFormat => 'yyyy-MM-dd',\n",{"type":43,"tag":614,"props":1949,"children":1950},{"class":616,"line":777},[1951],{"type":43,"tag":614,"props":1952,"children":1953},{},[1954],{"type":49,"value":1955},"  schema => 'sale_id INT, sale_date DATE, amount DECIMAL(10,2), store STRING'\n",{"type":43,"tag":614,"props":1957,"children":1958},{"class":616,"line":949},[1959],{"type":43,"tag":614,"props":1960,"children":1961},{},[1962],{"type":49,"value":1624},{"type":43,"tag":597,"props":1964,"children":1966},{"id":1965},"recursive-cte-hierarchy-traversal",[1967],{"type":49,"value":1968},"Recursive CTE - Hierarchy Traversal",{"type":43,"tag":604,"props":1970,"children":1972},{"className":606,"code":1971,"language":22,"meta":608,"style":608},"WITH RECURSIVE org_chart AS (\n  -- Anchor: top-level managers\n  SELECT employee_id, name, manager_id, 0 AS depth, ARRAY(name) AS path\n  FROM catalog.schema.employees\n  WHERE manager_id IS NULL\n\n  UNION ALL\n\n  -- Recursive: direct reports\n  SELECT e.employee_id, e.name, e.manager_id, o.depth + 1, array_append(o.path, e.name)\n  FROM catalog.schema.employees e\n  JOIN org_chart o ON e.manager_id = o.employee_id\n  WHERE o.depth \u003C 10  -- safety limit\n)\nSELECT * FROM org_chart ORDER BY depth, name;\n",[1973],{"type":43,"tag":108,"props":1974,"children":1975},{"__ignoreMap":608},[1976,1984,1992,2000,2008,2016,2023,2031,2038,2046,2054,2062,2070,2078,2085],{"type":43,"tag":614,"props":1977,"children":1978},{"class":616,"line":617},[1979],{"type":43,"tag":614,"props":1980,"children":1981},{},[1982],{"type":49,"value":1983},"WITH RECURSIVE org_chart AS (\n",{"type":43,"tag":614,"props":1985,"children":1986},{"class":616,"line":626},[1987],{"type":43,"tag":614,"props":1988,"children":1989},{},[1990],{"type":49,"value":1991},"  -- Anchor: top-level managers\n",{"type":43,"tag":614,"props":1993,"children":1994},{"class":616,"line":635},[1995],{"type":43,"tag":614,"props":1996,"children":1997},{},[1998],{"type":49,"value":1999},"  SELECT employee_id, name, manager_id, 0 AS depth, ARRAY(name) AS path\n",{"type":43,"tag":614,"props":2001,"children":2002},{"class":616,"line":644},[2003],{"type":43,"tag":614,"props":2004,"children":2005},{},[2006],{"type":49,"value":2007},"  FROM catalog.schema.employees\n",{"type":43,"tag":614,"props":2009,"children":2010},{"class":616,"line":654},[2011],{"type":43,"tag":614,"props":2012,"children":2013},{},[2014],{"type":49,"value":2015},"  WHERE manager_id IS NULL\n",{"type":43,"tag":614,"props":2017,"children":2018},{"class":616,"line":663},[2019],{"type":43,"tag":614,"props":2020,"children":2021},{"emptyLinePlaceholder":648},[2022],{"type":49,"value":651},{"type":43,"tag":614,"props":2024,"children":2025},{"class":616,"line":671},[2026],{"type":43,"tag":614,"props":2027,"children":2028},{},[2029],{"type":49,"value":2030},"  UNION ALL\n",{"type":43,"tag":614,"props":2032,"children":2033},{"class":616,"line":680},[2034],{"type":43,"tag":614,"props":2035,"children":2036},{"emptyLinePlaceholder":648},[2037],{"type":49,"value":651},{"type":43,"tag":614,"props":2039,"children":2040},{"class":616,"line":689},[2041],{"type":43,"tag":614,"props":2042,"children":2043},{},[2044],{"type":49,"value":2045},"  -- Recursive: direct reports\n",{"type":43,"tag":614,"props":2047,"children":2048},{"class":616,"line":698},[2049],{"type":43,"tag":614,"props":2050,"children":2051},{},[2052],{"type":49,"value":2053},"  SELECT e.employee_id, e.name, e.manager_id, o.depth + 1, array_append(o.path, e.name)\n",{"type":43,"tag":614,"props":2055,"children":2056},{"class":616,"line":707},[2057],{"type":43,"tag":614,"props":2058,"children":2059},{},[2060],{"type":49,"value":2061},"  FROM catalog.schema.employees e\n",{"type":43,"tag":614,"props":2063,"children":2064},{"class":616,"line":716},[2065],{"type":43,"tag":614,"props":2066,"children":2067},{},[2068],{"type":49,"value":2069},"  JOIN org_chart o ON e.manager_id = o.employee_id\n",{"type":43,"tag":614,"props":2071,"children":2072},{"class":616,"line":724},[2073],{"type":43,"tag":614,"props":2074,"children":2075},{},[2076],{"type":49,"value":2077},"  WHERE o.depth \u003C 10  -- safety limit\n",{"type":43,"tag":614,"props":2079,"children":2080},{"class":616,"line":733},[2081],{"type":43,"tag":614,"props":2082,"children":2083},{},[2084],{"type":49,"value":828},{"type":43,"tag":614,"props":2086,"children":2087},{"class":616,"line":742},[2088],{"type":43,"tag":614,"props":2089,"children":2090},{},[2091],{"type":49,"value":2092},"SELECT * FROM org_chart ORDER BY depth, name;\n",{"type":43,"tag":597,"props":2094,"children":2096},{"id":2095},"remote_query-federated-queries",[2097],{"type":49,"value":2098},"remote_query - Federated Queries",{"type":43,"tag":604,"props":2100,"children":2102},{"className":606,"code":2101,"language":22,"meta":608,"style":608},"-- Query PostgreSQL via Lakehouse Federation\nSELECT *\nFROM remote_query(\n  'my_postgres_connection',\n  database => 'my_database',\n  query    => 'SELECT customer_id, email, created_at FROM customers WHERE active = true'\n);\n",[2103],{"type":43,"tag":108,"props":2104,"children":2105},{"__ignoreMap":608},[2106,2114,2121,2129,2137,2145,2153],{"type":43,"tag":614,"props":2107,"children":2108},{"class":616,"line":617},[2109],{"type":43,"tag":614,"props":2110,"children":2111},{},[2112],{"type":49,"value":2113},"-- Query PostgreSQL via Lakehouse Federation\n",{"type":43,"tag":614,"props":2115,"children":2116},{"class":616,"line":626},[2117],{"type":43,"tag":614,"props":2118,"children":2119},{},[2120],{"type":49,"value":1823},{"type":43,"tag":614,"props":2122,"children":2123},{"class":616,"line":635},[2124],{"type":43,"tag":614,"props":2125,"children":2126},{},[2127],{"type":49,"value":2128},"FROM remote_query(\n",{"type":43,"tag":614,"props":2130,"children":2131},{"class":616,"line":644},[2132],{"type":43,"tag":614,"props":2133,"children":2134},{},[2135],{"type":49,"value":2136},"  'my_postgres_connection',\n",{"type":43,"tag":614,"props":2138,"children":2139},{"class":616,"line":654},[2140],{"type":43,"tag":614,"props":2141,"children":2142},{},[2143],{"type":49,"value":2144},"  database => 'my_database',\n",{"type":43,"tag":614,"props":2146,"children":2147},{"class":616,"line":663},[2148],{"type":43,"tag":614,"props":2149,"children":2150},{},[2151],{"type":49,"value":2152},"  query    => 'SELECT customer_id, email, created_at FROM customers WHERE active = true'\n",{"type":43,"tag":614,"props":2154,"children":2155},{"class":616,"line":671},[2156],{"type":43,"tag":614,"props":2157,"children":2158},{},[2159],{"type":49,"value":1624},{"type":43,"tag":587,"props":2161,"children":2162},{},[],{"type":43,"tag":52,"props":2164,"children":2166},{"id":2165},"reference-files",[2167],{"type":49,"value":2168},"Reference Files",{"type":43,"tag":2170,"props":2171,"children":2172},"p",{},[2173],{"type":49,"value":2174},"Load these for detailed syntax, full parameter lists, and advanced patterns:",{"type":43,"tag":59,"props":2176,"children":2177},{},[2178,2199],{"type":43,"tag":63,"props":2179,"children":2180},{},[2181],{"type":43,"tag":67,"props":2182,"children":2183},{},[2184,2189,2194],{"type":43,"tag":71,"props":2185,"children":2186},{},[2187],{"type":49,"value":2188},"File",{"type":43,"tag":71,"props":2190,"children":2191},{},[2192],{"type":49,"value":2193},"Contents",{"type":43,"tag":71,"props":2195,"children":2196},{},[2197],{"type":49,"value":2198},"When to Read",{"type":43,"tag":92,"props":2200,"children":2201},{},[2202,2222,2242,2262,2282],{"type":43,"tag":67,"props":2203,"children":2204},{},[2205,2212,2217],{"type":43,"tag":99,"props":2206,"children":2207},{},[2208],{"type":43,"tag":138,"props":2209,"children":2210},{"href":140},[2211],{"type":49,"value":140},{"type":43,"tag":99,"props":2213,"children":2214},{},[2215],{"type":49,"value":2216},"SQL Scripting, Stored Procedures, Recursive CTEs, Transactions",{"type":43,"tag":99,"props":2218,"children":2219},{},[2220],{"type":49,"value":2221},"User needs procedural SQL, error handling, loops, dynamic SQL",{"type":43,"tag":67,"props":2223,"children":2224},{},[2225,2232,2237],{"type":43,"tag":99,"props":2226,"children":2227},{},[2228],{"type":43,"tag":138,"props":2229,"children":2230},{"href":263},[2231],{"type":49,"value":263},{"type":43,"tag":99,"props":2233,"children":2234},{},[2235],{"type":49,"value":2236},"Materialized Views, Temp Tables\u002FViews, Pipe Syntax",{"type":43,"tag":99,"props":2238,"children":2239},{},[2240],{"type":49,"value":2241},"User needs MVs, refresh scheduling, temp objects, pipe operator",{"type":43,"tag":67,"props":2243,"children":2244},{},[2245,2252,2257],{"type":43,"tag":99,"props":2246,"children":2247},{},[2248],{"type":43,"tag":138,"props":2249,"children":2250},{"href":360},[2251],{"type":49,"value":360},{"type":43,"tag":99,"props":2253,"children":2254},{},[2255],{"type":49,"value":2256},"39 H3 functions, 80+ ST functions, Collation types and hierarchy",{"type":43,"tag":99,"props":2258,"children":2259},{},[2260],{"type":49,"value":2261},"User needs spatial analysis, H3 indexing, case\u002Faccent handling",{"type":43,"tag":67,"props":2263,"children":2264},{},[2265,2272,2277],{"type":43,"tag":99,"props":2266,"children":2267},{},[2268],{"type":43,"tag":138,"props":2269,"children":2270},{"href":474},[2271],{"type":49,"value":474},{"type":43,"tag":99,"props":2273,"children":2274},{},[2275],{"type":49,"value":2276},"13 AI functions, http_request, remote_query, read_files (all options)",{"type":43,"tag":99,"props":2278,"children":2279},{},[2280],{"type":49,"value":2281},"User needs AI enrichment, API calls, federation, file ingestion",{"type":43,"tag":67,"props":2283,"children":2284},{},[2285,2292,2297],{"type":43,"tag":99,"props":2286,"children":2287},{},[2288],{"type":43,"tag":138,"props":2289,"children":2290},{"href":583},[2291],{"type":49,"value":583},{"type":43,"tag":99,"props":2293,"children":2294},{},[2295],{"type":49,"value":2296},"Data modeling, performance, Liquid Clustering, anti-patterns",{"type":43,"tag":99,"props":2298,"children":2299},{},[2300],{"type":49,"value":2301},"User needs architecture guidance, optimization, or modeling advice",{"type":43,"tag":587,"props":2303,"children":2304},{},[],{"type":43,"tag":52,"props":2306,"children":2308},{"id":2307},"key-guidelines",[2309],{"type":49,"value":2310},"Key Guidelines",{"type":43,"tag":2312,"props":2313,"children":2314},"ul",{},[2315,2327,2345,2355,2370,2380,2390,2405],{"type":43,"tag":2316,"props":2317,"children":2318},"li",{},[2319,2325],{"type":43,"tag":2320,"props":2321,"children":2322},"strong",{},[2323],{"type":49,"value":2324},"Always use Serverless SQL warehouses",{"type":49,"value":2326}," for AI functions, MVs, and http_request",{"type":43,"tag":2316,"props":2328,"children":2329},{},[2330,2343],{"type":43,"tag":2320,"props":2331,"children":2332},{},[2333,2335,2341],{"type":49,"value":2334},"Use ",{"type":43,"tag":108,"props":2336,"children":2338},{"className":2337},[],[2339],{"type":49,"value":2340},"LIMIT",{"type":49,"value":2342}," during development",{"type":49,"value":2344}," with AI functions to control costs",{"type":43,"tag":2316,"props":2346,"children":2347},{},[2348,2353],{"type":43,"tag":2320,"props":2349,"children":2350},{},[2351],{"type":49,"value":2352},"Prefer Liquid Clustering over partitioning",{"type":49,"value":2354}," for new tables (1-4 keys max)",{"type":43,"tag":2316,"props":2356,"children":2357},{},[2358,2368],{"type":43,"tag":2320,"props":2359,"children":2360},{},[2361,2362],{"type":49,"value":2334},{"type":43,"tag":108,"props":2363,"children":2365},{"className":2364},[],[2366],{"type":49,"value":2367},"CLUSTER BY AUTO",{"type":49,"value":2369}," when unsure about clustering keys",{"type":43,"tag":2316,"props":2371,"children":2372},{},[2373,2378],{"type":43,"tag":2320,"props":2374,"children":2375},{},[2376],{"type":49,"value":2377},"Star schema in Gold layer",{"type":49,"value":2379}," for BI; OBT acceptable in Silver",{"type":43,"tag":2316,"props":2381,"children":2382},{},[2383,2388],{"type":43,"tag":2320,"props":2384,"children":2385},{},[2386],{"type":49,"value":2387},"Define PK\u002FFK constraints",{"type":49,"value":2389}," on dimensional models for query optimization",{"type":43,"tag":2316,"props":2391,"children":2392},{},[2393,2403],{"type":43,"tag":2320,"props":2394,"children":2395},{},[2396,2397],{"type":49,"value":2334},{"type":43,"tag":108,"props":2398,"children":2400},{"className":2399},[],[2401],{"type":49,"value":2402},"COLLATE UTF8_LCASE",{"type":49,"value":2404}," for user-facing string columns that need case-insensitive search",{"type":43,"tag":2316,"props":2406,"children":2407},{},[2408,2413,2415,2421,2423,2429,2431,2437],{"type":43,"tag":2320,"props":2409,"children":2410},{},[2411],{"type":49,"value":2412},"Test SQL via CLI",{"type":49,"value":2414}," (",{"type":43,"tag":108,"props":2416,"children":2418},{"className":2417},[],[2419],{"type":49,"value":2420},"databricks experimental aitools tools query",{"type":49,"value":2422},") or notebooks before deploying. If ",{"type":43,"tag":108,"props":2424,"children":2426},{"className":2425},[],[2427],{"type":49,"value":2428},"--warehouse",{"type":49,"value":2430}," is rejected on your CLI version, set ",{"type":43,"tag":108,"props":2432,"children":2434},{"className":2433},[],[2435],{"type":49,"value":2436},"DATABRICKS_WAREHOUSE_ID",{"type":49,"value":2438}," in the environment instead.",{"type":43,"tag":2440,"props":2441,"children":2442},"style",{},[2443],{"type":49,"value":2444},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2446,"total":2564},[2447,2464,2476,2493,2510,2530,2541],{"slug":2448,"name":2448,"fn":2449,"description":2450,"org":2451,"tags":2452,"stars":23,"repoUrl":24,"updatedAt":2463},"databricks-agent-bricks","create Databricks Agent Bricks","Create Agent Bricks: Knowledge Assistants (KA) for document Q&A and Supervisor Agents for multi-agent orchestration (MAS).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2453,2456,2457,2460],{"name":2454,"slug":2455,"type":15},"Agents","agents",{"name":9,"slug":8,"type":15},{"name":2458,"slug":2459,"type":15},"Knowledge Management","knowledge-management",{"name":2461,"slug":2462,"type":15},"Multi-Agent","multi-agent","2026-07-15T05:41:38.548954",{"slug":2465,"name":2465,"fn":2466,"description":2467,"org":2468,"tags":2469,"stars":23,"repoUrl":24,"updatedAt":2475},"databricks-ai-functions","use Databricks built-in AI functions","Use Databricks built-in AI Functions (ai_classify, ai_extract, ai_summarize, ai_mask, ai_translate, ai_fix_grammar, ai_gen, ai_analyze_sentiment, ai_similarity, ai_parse_document, ai_prep_search, ai_query, ai_forecast) to add AI capabilities directly to SQL and PySpark pipelines without managing model endpoints. Also covers document parsing and building custom RAG pipelines (parse → prep_search → index → query).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2470,2471,2472],{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":2473,"slug":2474,"type":15},"LLM","llm","2026-07-31T05:53:33.562077",{"slug":2477,"name":2477,"fn":2478,"description":2479,"org":2480,"tags":2481,"stars":23,"repoUrl":24,"updatedAt":2492},"databricks-ai-runtime","submit and manage Databricks GPU workloads","Databricks AI Runtime (`air`) CLI — the command-line tool for submitting and managing GPU training workloads on Databricks serverless compute. Use for: running `air` workloads, custom Docker image setup, environment configuration, and troubleshooting `air` jobs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2482,2485,2486,2489],{"name":2483,"slug":2484,"type":15},"CLI","cli",{"name":9,"slug":8,"type":15},{"name":2487,"slug":2488,"type":15},"Docker","docker",{"name":2490,"slug":2491,"type":15},"Engineering","engineering","2026-07-12T08:04:55.843982",{"slug":2494,"name":2494,"fn":2495,"description":2496,"org":2497,"tags":2498,"stars":23,"repoUrl":24,"updatedAt":2509},"databricks-aibi-dashboards","create Databricks AI\u002FBI dashboards","Create Databricks AI\u002FBI dashboards. Must use when creating, updating, or deploying Lakeview dashboards as Databricks Dashboard have a unique json structure. CRITICAL: You MUST test ALL SQL queries via CLI BEFORE deploying. Follow guidelines strictly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2499,2502,2505,2508],{"name":2500,"slug":2501,"type":15},"Analytics","analytics",{"name":2503,"slug":2504,"type":15},"Dashboards","dashboards",{"name":2506,"slug":2507,"type":15},"Data Visualization","data-visualization",{"name":9,"slug":8,"type":15},"2026-07-12T08:04:25.314591",{"slug":2511,"name":2511,"fn":2512,"description":2513,"org":2514,"tags":2515,"stars":23,"repoUrl":24,"updatedAt":2529},"databricks-app-design","design UX for Databricks AppKit applications","Design the UX of custom-code Databricks Apps (AppKit\u002FReact) data screens — KPI\u002Foverview pages, reports, charts, tables, and Genie\u002Fchat data assistants — mapped to concrete AppKit components. Use when BUILDING or reviewing the UI of an AppKit\u002FReact app that displays data or answers data questions: choosing genre, layout, charts, KPIs, semantic color, required states (loading\u002Fempty\u002Ferror), IBCS notation, and AI-result trust (showing generated SQL\u002Fsources for Genie\u002Fchat). A plain \"create a dashboard\" request means a managed AI\u002FBI (Lakeview) dashboard → use databricks-aibi-dashboards, NOT this skill. Also NOT for non-data frontend (forms, settings, auth, marketing) or scaffolding\u002Fbuild\u002Fdeploy (→ databricks-apps). Complements databricks-apps; use it alongside whenever a custom app has a chart, table, KPI, report, or Genie\u002Fchat\u002FAI surface.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2516,2517,2520,2523,2526],{"name":9,"slug":8,"type":15},{"name":2518,"slug":2519,"type":15},"Design","design",{"name":2521,"slug":2522,"type":15},"Frontend","frontend",{"name":2524,"slug":2525,"type":15},"React","react",{"name":2527,"slug":2528,"type":15},"UI Components","ui-components","2026-07-12T08:04:02.02398",{"slug":2531,"name":2531,"fn":2532,"description":2533,"org":2534,"tags":2535,"stars":23,"repoUrl":24,"updatedAt":2540},"databricks-apps","build applications on Databricks Apps","Build apps on Databricks Apps platform. Use when asked to create data apps, analytics tools, or custom interactive visualizations. A plain \"create a dashboard\" request means a managed AI\u002FBI (Lakeview) dashboard → use databricks-aibi-dashboards, not this skill. Evaluates data access patterns (analytics vs Lakebase synced tables) before scaffolding. Invoke BEFORE starting implementation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2536,2537,2538,2539],{"name":2500,"slug":2501,"type":15},{"name":2503,"slug":2504,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-12T08:03:59.061458",{"slug":2542,"name":2542,"fn":2543,"description":2544,"org":2545,"tags":2546,"stars":23,"repoUrl":24,"updatedAt":2563},"databricks-apps-python","build Python backends for Databricks Apps","Python backend for Databricks Apps — FastAPI (default), Flask, Dash, Streamlit, Gradio, Reflex. **Default for a new Databricks App is `databricks-apps` (AppKit — Node\u002FTypeScript\u002FReact) — reach for it first.** Use this skill only when the user asks for a Python backend, extends an existing Python app, or the team is Python-only. Covers OAuth auth, app resources, SQL warehouse and Lakebase connectivity, foundation-model \u002F Vector Search \u002F model-serving APIs (via `databricks-python-sdk`), and deployment via CLI or DABs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2547,2548,2551,2554,2557,2560],{"name":9,"slug":8,"type":15},{"name":2549,"slug":2550,"type":15},"FastAPI","fastapi",{"name":2552,"slug":2553,"type":15},"Flask","flask",{"name":2555,"slug":2556,"type":15},"Gradio","gradio",{"name":2558,"slug":2559,"type":15},"Python","python",{"name":2561,"slug":2562,"type":15},"Streamlit","streamlit","2026-07-12T08:04:10.970845",31,{"items":2566,"total":2564},[2567,2574,2580,2587,2594,2602,2609,2618,2629,2646,2659,2666],{"slug":2448,"name":2448,"fn":2449,"description":2450,"org":2568,"tags":2569,"stars":23,"repoUrl":24,"updatedAt":2463},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2570,2571,2572,2573],{"name":2454,"slug":2455,"type":15},{"name":9,"slug":8,"type":15},{"name":2458,"slug":2459,"type":15},{"name":2461,"slug":2462,"type":15},{"slug":2465,"name":2465,"fn":2466,"description":2467,"org":2575,"tags":2576,"stars":23,"repoUrl":24,"updatedAt":2475},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2577,2578,2579],{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":2473,"slug":2474,"type":15},{"slug":2477,"name":2477,"fn":2478,"description":2479,"org":2581,"tags":2582,"stars":23,"repoUrl":24,"updatedAt":2492},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2583,2584,2585,2586],{"name":2483,"slug":2484,"type":15},{"name":9,"slug":8,"type":15},{"name":2487,"slug":2488,"type":15},{"name":2490,"slug":2491,"type":15},{"slug":2494,"name":2494,"fn":2495,"description":2496,"org":2588,"tags":2589,"stars":23,"repoUrl":24,"updatedAt":2509},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2590,2591,2592,2593],{"name":2500,"slug":2501,"type":15},{"name":2503,"slug":2504,"type":15},{"name":2506,"slug":2507,"type":15},{"name":9,"slug":8,"type":15},{"slug":2511,"name":2511,"fn":2512,"description":2513,"org":2595,"tags":2596,"stars":23,"repoUrl":24,"updatedAt":2529},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2597,2598,2599,2600,2601],{"name":9,"slug":8,"type":15},{"name":2518,"slug":2519,"type":15},{"name":2521,"slug":2522,"type":15},{"name":2524,"slug":2525,"type":15},{"name":2527,"slug":2528,"type":15},{"slug":2531,"name":2531,"fn":2532,"description":2533,"org":2603,"tags":2604,"stars":23,"repoUrl":24,"updatedAt":2540},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2605,2606,2607,2608],{"name":2500,"slug":2501,"type":15},{"name":2503,"slug":2504,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":2542,"name":2542,"fn":2543,"description":2544,"org":2610,"tags":2611,"stars":23,"repoUrl":24,"updatedAt":2563},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2612,2613,2614,2615,2616,2617],{"name":9,"slug":8,"type":15},{"name":2549,"slug":2550,"type":15},{"name":2552,"slug":2553,"type":15},{"name":2555,"slug":2556,"type":15},{"name":2558,"slug":2559,"type":15},{"name":2561,"slug":2562,"type":15},{"slug":38,"name":38,"fn":2619,"description":2620,"org":2621,"tags":2622,"stars":23,"repoUrl":24,"updatedAt":2628},"configure Databricks CLI and authentication","Databricks CLI operations and the parent\u002Fentry-point skill for Databricks CLI use: authentication, profile selection, and bundles. Load this first for CLI, auth, profile, and bundle tasks, then load the matching product skill. For finding or exploring data, answering questions about the data, or generating SQL, load the databricks-data-discovery skill (it routes to Genie One). Contains up-to-date guidelines for Databricks-related CLI tasks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2623,2626,2627],{"name":2624,"slug":2625,"type":15},"Authentication","authentication",{"name":2483,"slug":2484,"type":15},{"name":9,"slug":8,"type":15},"2026-07-18T05:11:05.45506",{"slug":2630,"name":2630,"fn":2631,"description":2632,"org":2633,"tags":2634,"stars":23,"repoUrl":24,"updatedAt":2645},"databricks-dabs","manage Databricks Declarative Automation Bundles","Create, configure, validate, deploy, run, and manage Declarative Automation Bundles (DABs, formerly Databricks Asset Bundles). Use when working with Databricks resources via DABs including dashboards, jobs, pipelines, alerts, volumes, and apps.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2635,2638,2641,2642],{"name":2636,"slug":2637,"type":15},"Automation","automation",{"name":2639,"slug":2640,"type":15},"Configuration","configuration",{"name":9,"slug":8,"type":15},{"name":2643,"slug":2644,"type":15},"Deployment","deployment","2026-07-15T05:41:35.930355",{"slug":2647,"name":2647,"fn":2648,"description":2649,"org":2650,"tags":2651,"stars":23,"repoUrl":24,"updatedAt":2658},"databricks-data-discovery","discover and query Databricks data","Discover, explore, and query Databricks data via Genie — the CLI equivalent of the Genie One MCP. MUST be invoked whenever the user asks to find or locate data ('what tables are in X', 'where does X live', 'which catalog\u002Fschema has Y'), answer a natural-language question about the data, or write a SQL query.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2652,2653,2656,2657],{"name":13,"slug":14,"type":15},{"name":2654,"slug":2655,"type":15},"Data Engineering","data-engineering",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"2026-07-31T05:53:32.561877",{"slug":4,"name":4,"fn":5,"description":6,"org":2660,"tags":2661,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2662,2663,2664,2665],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"slug":2667,"name":2667,"fn":2668,"description":2669,"org":2670,"tags":2671,"stars":23,"repoUrl":24,"updatedAt":2678},"databricks-docs","search Databricks documentation","Databricks documentation reference via llms.txt index. Use when other skills do not cover a topic, looking up unfamiliar Databricks features, or needing authoritative docs on APIs, configurations, or platform capabilities.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2672,2673,2676],{"name":9,"slug":8,"type":15},{"name":2674,"slug":2675,"type":15},"Documentation","documentation",{"name":90,"slug":2677,"type":15},"reference","2026-07-15T05:41:34.697746"]