{"title":"Snowflake","description":"Add Snowflake as an external catalog in Altertable so teams can query warehouse data with lakehouse analytics.","order":110,"askSuggestions":["How do I restrict the access token to one Snowflake role?","Why use a programmatic access token instead of a password?"],"navigation":true,"body":{"code":"var Component=(()=>{var f=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var S=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),b=(o,e)=>{for(var r in e)i(o,r,{get:e[r],enumerable:!0})},d=(o,e,r,a)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let t of g(e))!y.call(o,t)&&t!==r&&i(o,t,{get:()=>e[t],enumerable:!(a=p(e,t))||a.enumerable});return o};var A=(o,e,r)=>(r=o!=null?f(m(o)):{},d(e||!o||!o.__esModule?i(r,\"default\",{value:o,enumerable:!0}):r,o)),x=o=>d(i({},\"__esModule\",{value:!0}),o);var u=S((T,h)=>{h.exports=_jsx_runtime});var q={};b(q,{default:()=>k,frontmatter:()=>D});var n=A(u()),D={title:\"Snowflake\",description:\"Add Snowflake as an external catalog in Altertable so teams can query warehouse data with lakehouse analytics.\",order:110,askSuggestions:[\"How do I restrict the access token to one Snowflake role?\",\"Why use a programmatic access token instead of a password?\"]};function w(o){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",h3:\"h3\",h4:\"h4\",li:\"li\",ol:\"ol\",p:\"p\",pre:\"pre\",strong:\"strong\",ul:\"ul\",...o.components},{DocsCallout:r,DocsPreviewDocument:a,DocsPreviewSection:t,DocsSnowflakeNetworkPolicySql:l,Screenshot:s}=e;return r||c(\"DocsCallout\",!0),a||c(\"DocsPreviewDocument\",!0),t||c(\"DocsPreviewSection\",!0),l||c(\"DocsSnowflakeNetworkPolicySql\",!0),s||c(\"Screenshot\",!0),(0,n.jsxs)(a,{anchors:\"snowflake prerequisites setup-snowflake-network-policy example-creating-a-network-policy create-an-access-token connecting-to-altertable\",children:[(0,n.jsxs)(t,{sectionId:\"snowflake\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,n.jsx)(e.h1,{id:\"snowflake\",children:\"Snowflake\"}),`\n`,(0,n.jsx)(e.p,{children:\"Add your Snowflake warehouse as an external catalog in Altertable to query and analyze it alongside your other data sources.\"}),`\n`]}),(0,n.jsxs)(t,{sectionId:\"prerequisites\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,n.jsx)(e.h2,{id:\"prerequisites\",children:\"Prerequisites\"}),`\n`]}),(0,n.jsxs)(t,{sectionId:\"setup-snowflake-network-policy\",anchors:\"\",ancestors:\"prerequisites\",index:\"2\",children:[(0,n.jsx)(e.h3,{id:\"setup-snowflake-network-policy\",children:\"Setup Snowflake Network Policy\"}),`\n`,(0,n.jsx)(e.p,{children:\"Before connecting Snowflake to Altertable, you'll need to configure your Snowflake network policy to allow connections from Altertable.\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"Update your Snowflake network policy to include \",(0,n.jsx)(e.a,{href:\"/docs/administration/network#egress-ip-addresses\",children:\"Altertable's egress IP addresses\"}),\" in the allowed list.\"]}),`\n`]}),(0,n.jsxs)(t,{sectionId:\"example-creating-a-network-policy\",anchors:\"\",ancestors:\"prerequisites setup-snowflake-network-policy\",index:\"3\",children:[(0,n.jsx)(e.h4,{id:\"example-creating-a-network-policy\",children:\"Example: Creating a Network Policy\"}),`\n`,(0,n.jsx)(e.p,{children:\"You can create a network rule in and network policy to allow Altertable's IP address:\"}),`\n`,(0,n.jsx)(l,{}),`\n`,(0,n.jsxs)(e.p,{children:[\"This ensures that Altertable can establish connections to your Snowflake account. Refer to Snowflake's \",(0,n.jsx)(e.a,{href:\"https://docs.snowflake.com/en/user-guide/network-policies\",children:\"network policy documentation\"}),\" for more details on managing network policies.\"]}),`\n`]}),(0,n.jsxs)(t,{sectionId:\"create-an-access-token\",anchors:\"\",ancestors:\"prerequisites\",index:\"4\",children:[(0,n.jsx)(e.h3,{id:\"create-an-access-token\",children:\"Create an Access Token\"}),`\n`,(0,n.jsxs)(r,{title:\"Recommendation: use an access token\",children:[(0,n.jsx)(e.p,{children:\"A programmatic access token isn't required\\u2014Altertable can authenticate with your password\\u2014but using one is recommended because it lets you:\"}),(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsx)(e.li,{children:\"Avoid sharing your Snowflake account password\"}),`\n`,(0,n.jsx)(e.li,{children:\"Bypass multi-factor authentication (TOTP)\"}),`\n`,(0,n.jsx)(e.li,{children:\"Revoke Altertable's access at any time without changing your password\"}),`\n`]})]}),`\n`,(0,n.jsx)(e.p,{children:\"Generate one for the user and role you want Altertable to connect with:\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sql\",children:`ALTER USER \"<username>\" ADD  PROGRAMMATIC ACCESS TOKEN altertable_token\n  ROLE_RESTRICTION = '<role>'\n  DAYS_TO_EXPIRY = 365;\n`})}),`\n`]}),(0,n.jsxs)(t,{sectionId:\"connecting-to-altertable\",anchors:\"\",ancestors:\"\",index:\"5\",children:[(0,n.jsx)(e.h2,{id:\"connecting-to-altertable\",children:\"Connecting to Altertable\"}),`\n`,(0,n.jsx)(e.p,{children:\"To add a new Snowflake external catalog:\"}),`\n`,(0,n.jsxs)(e.ol,{children:[`\n`,(0,n.jsxs)(e.li,{children:[\"Navigate to the \",(0,n.jsx)(e.strong,{children:\"Catalogs\"}),\" section in the dashboard\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Click \",(0,n.jsx)(e.strong,{children:\"New catalog\"})]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Select \",(0,n.jsx)(e.strong,{children:\"Snowflake\"}),\" as the engine\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Fill in the connection details:\",`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Snowflake Account URL\"}),\": Your Snowflake account URL (\",(0,n.jsx)(e.a,{href:\"https://docs.snowflake.com/en/user-guide/admin-account-identifier\",children:\"learn how to find your account URL\"}),\")\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Snowflake Warehouse\"}),\": The warehouse to use for queries (\",(0,n.jsx)(e.a,{href:\"https://docs.snowflake.com/en/user-guide/warehouses-overview\",children:\"learn more about warehouses\"}),\")\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Username\"}),\": Your Snowflake username\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Access Token\"}),\": Your Snowflake access token\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Database\"}),\": The name of the database to connect to\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Schema\"}),\" (optional): The name of the schema to connect to\"]}),`\n`]}),`\n`]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Click \",(0,n.jsx)(e.strong,{children:\"Save\"})]}),`\n`]}),`\n`,(0,n.jsx)(s,{story:\"components-connectionform--snowflake-empty\",caption:\"New Snowflake connection form\",width:\"1408\",height:\"2096\"}),`\n`,(0,n.jsx)(e.p,{children:\"Once added, you can start querying your Snowflake data through Altertable's SQL engine.\"})]})]})}function k(o={}){let{wrapper:e}=o.components||{};return e?(0,n.jsx)(e,{...o,children:(0,n.jsx)(w,{...o})}):w(o)}function c(o,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+o+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return x(q);})();\n;return Component;"},"_id":"docs/lakehouse/external-catalogs/snowflake.mdx","_raw":{"sourceFilePath":"docs/lakehouse/external-catalogs/snowflake.mdx","sourceFileName":"snowflake.mdx","sourceFileDir":"docs/lakehouse/external-catalogs","contentType":"mdx","flattenedPath":"docs/lakehouse/external-catalogs/snowflake"},"type":"Docs","path":"/lakehouse/external-catalogs/snowflake","level":3,"parent":"lakehouse/external-catalogs"}