{"title":"Bucket Tables","description":"Map files in a connected bucket to external Altertable tables and query object storage data from the lakehouse.","order":200,"askSuggestions":["How do I map a folder of files as one table?","When should I use Iceberg Tables instead of Bucket Tables?","How do I join bucket files with other catalogs?"],"navigation":true,"routeId":"lakehouseBucketTables","body":{"code":"var Component=(()=>{var b=Object.create;var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var g=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),x=(n,e)=>{for(var a in e)s(n,a,{get:e[a],enumerable:!0})},c=(n,e,a,l)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let o of m(e))!k.call(n,o)&&o!==a&&s(n,o,{get:()=>e[o],enumerable:!(l=p(e,o))||l.enumerable});return n};var T=(n,e,a)=>(a=n!=null?b(f(n)):{},c(e||!n||!n.__esModule?s(a,\"default\",{value:n,enumerable:!0}):a,n)),w=n=>c(s({},\"__esModule\",{value:!0}),n);var h=g((I,r)=>{r.exports=_jsx_runtime});var S={};x(S,{default:()=>u,frontmatter:()=>y});var t=T(h()),y={title:\"Bucket Tables\",routeId:\"lakehouseBucketTables\",description:\"Map files in a connected bucket to external Altertable tables and query object storage data from the lakehouse.\",order:200,askSuggestions:[\"How do I map a folder of files as one table?\",\"When should I use Iceberg Tables instead of Bucket Tables?\",\"How do I join bucket files with other catalogs?\"]};function d(n){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",li:\"li\",ol:\"ol\",p:\"p\",strong:\"strong\",ul:\"ul\",...n.components},{DocsPreviewDocument:a,DocsPreviewSection:l,DocsTable:o}=e;return a||i(\"DocsPreviewDocument\",!0),l||i(\"DocsPreviewSection\",!0),o||i(\"DocsTable\",!0),(0,t.jsxs)(a,{anchors:\"bucket-tables when-to-use-bucket-tables connect-bucket-tables table-mappings\",children:[(0,t.jsxs)(l,{sectionId:\"bucket-tables\",sectionTitle:\"Bucket Tables\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,t.jsx)(e.h1,{id:\"bucket-tables\",children:\"Bucket Tables\"}),`\n`,(0,t.jsxs)(e.p,{children:[\"Bucket Tables expose files from a connected \",(0,t.jsx)(e.a,{href:\"/docs/lakehouse/storage/buckets\",children:\"bucket\"}),\" as queryable external tables. Use them when Parquet, CSV, or JSON files already exist in object storage and you want to query them without copying the data into an Altertable catalog.\"]}),`\n`,(0,t.jsx)(e.p,{children:\"Each table maps a logical table name to a path in the bucket. Queries read the files at that path through the lakehouse SQL engine.\"}),`\n`]}),(0,t.jsxs)(l,{sectionId:\"when-to-use-bucket-tables\",sectionTitle:\"When to use Bucket Tables\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,t.jsx)(e.h2,{id:\"when-to-use-bucket-tables\",children:\"When to use Bucket Tables\"}),`\n`,(0,t.jsx)(e.p,{children:\"Use Bucket Tables for:\"}),`\n`,(0,t.jsxs)(e.ul,{children:[`\n`,(0,t.jsx)(e.li,{children:\"Data exports that already land in object storage.\"}),`\n`,(0,t.jsx)(e.li,{children:\"Shared Parquet datasets owned by another pipeline.\"}),`\n`,(0,t.jsx)(e.li,{children:\"CSV or JSON files that need to be joined with other lakehouse sources.\"}),`\n`,(0,t.jsx)(e.li,{children:\"Hive-style partitioned paths where partition keys should be available as columns.\"}),`\n`]}),`\n`,(0,t.jsxs)(e.p,{children:[\"If the files are an Iceberg dataset, use \",(0,t.jsx)(e.a,{href:\"/docs/lakehouse/external-catalogs/iceberg-tables\",children:\"Iceberg Tables\"}),\" instead so Altertable can read Iceberg metadata.\"]}),`\n`]}),(0,t.jsxs)(l,{sectionId:\"connect-bucket-tables\",sectionTitle:\"Connect Bucket Tables\",anchors:\"\",ancestors:\"\",index:\"2\",children:[(0,t.jsx)(e.h2,{id:\"connect-bucket-tables\",children:\"Connect Bucket Tables\"}),`\n`,(0,t.jsxs)(e.ol,{children:[`\n`,(0,t.jsxs)(e.li,{children:[\"Open \",(0,t.jsx)(e.strong,{children:\"Catalogs\"}),\" in the Altertable app.\"]}),`\n`,(0,t.jsxs)(e.li,{children:[\"Click \",(0,t.jsx)(e.strong,{children:\"New catalog\"}),\".\"]}),`\n`,(0,t.jsxs)(e.li,{children:[\"Select \",(0,t.jsx)(e.strong,{children:\"Bucket Tables\"}),\".\"]}),`\n`,(0,t.jsx)(e.li,{children:\"Choose the connected bucket that contains the files.\"}),`\n`,(0,t.jsx)(e.li,{children:\"Select the file format: Parquet, CSV, or JSON.\"}),`\n`,(0,t.jsx)(e.li,{children:\"Add one or more table mappings with a table name and path.\"}),`\n`,(0,t.jsx)(e.li,{children:\"Save the catalog, then query the mapped tables with SQL.\"}),`\n`]}),`\n`]}),(0,t.jsxs)(l,{sectionId:\"table-mappings\",sectionTitle:\"Table mappings\",anchors:\"\",ancestors:\"\",index:\"3\",children:[(0,t.jsx)(e.h2,{id:\"table-mappings\",children:\"Table mappings\"}),`\n`,(0,t.jsx)(e.p,{children:\"Use stable, descriptive table names and point each one at the file or prefix Altertable should read:\"}),`\n`,(0,t.jsx)(o,{columns:[\"Field\",\"Description\",\"Example\"],data:[{Field:\"Table name\",Description:\"The table name exposed in the external catalog\",Example:\"`events`\"},{Field:\"Path\",Description:\"The file path or prefix inside the connected bucket\",Example:\"`exports/events/`\"}]}),`\n`,(0,t.jsxs)(e.p,{children:[\"After the catalog is connected, query tables with fully qualified names such as \",(0,t.jsx)(e.code,{children:\"bucket_exports.main.events\"}),\".\"]})]})]})}function u(n={}){let{wrapper:e}=n.components||{};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(d,{...n})}):d(n)}function i(n,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+n+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return w(S);})();\n;return Component;"},"_id":"docs/lakehouse/external-catalogs/bucket-tables.mdx","_raw":{"sourceFilePath":"docs/lakehouse/external-catalogs/bucket-tables.mdx","sourceFileName":"bucket-tables.mdx","sourceFileDir":"docs/lakehouse/external-catalogs","contentType":"mdx","flattenedPath":"docs/lakehouse/external-catalogs/bucket-tables"},"type":"Docs","path":"/lakehouse/external-catalogs/bucket-tables","level":3,"parent":"lakehouse/external-catalogs"}