{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Composable Publish Tutorial: Publish Data to Databricks","description":"Set up Composable Publish end to end — provision Iceberg catalog resources, connect Databricks, and publish Treasure AI tables for zero-copy reads.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"composable-publish-tutorial","__idx":0},"children":["Composable Publish Tutorial"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Composable Publish shares tables managed in Treasure AI with your cloud data warehouse (CDW) without copying data. You publish tables in Apache Iceberg format to an export database, and the warehouse queries them in place through the Iceberg catalog — no export jobs, no transfer delays, no second copy to govern. This tutorial walks the complete path using Databricks as the warehouse: a one-time setup workflow performed by admins, followed by the recurring publish workflow performed by a data engineer."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This feature is not enabled on accounts by default. Contact Technical Support or your Customer Success representative to enable it."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-composable-publish-works","__idx":1},"children":["How Composable Publish Works"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each Treasure AI account gets a dedicated set of AWS resources: an S3 bucket that stores Iceberg table data, a Glue database (the default ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["export"]}," database) that holds table metadata, and a read-only IAM role that external warehouses assume to read the data. Data engineers write Iceberg tables from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench"},"children":["Data Workbench"]}," using Trino. The warehouse connects to the catalog by assuming the reader role and reads table data directly from S3."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The tutorial covers two workflows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Workflow"},"children":["Workflow"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Who performs it"},"children":["Who performs it"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Frequency"},"children":["Frequency"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#workflow-1-set-up-the-integration"},"children":["Set up the integration"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI admin + warehouse admin"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Once per account"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#workflow-2-publish-data"},"children":["Publish data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Data engineer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Recurring"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Composable Publish feature is enabled on your account"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Treasure AI ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["admin"]}," API key for Workflow 1; the publishing user's API key for Workflow 2. Write-only API keys are rejected. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/use-iceberg-catalog-api"},"children":["Use Iceberg Catalog Management API"]}," for authentication and the endpoint for your site — examples below use the US endpoint"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Unity Catalog enabled on your Databricks workspace and compute (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.databricks.com/aws/en/data-governance/unity-catalog/enable-workspaces"},"children":["Databricks docs"]},"), with privileges to create credentials, external locations, connections, and catalogs"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Familiarity with running Trino queries in Data Workbench (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/trino/quickstart"},"children":["Data Workbench Trino Quickstart"]},")"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"workflow-1-set-up-the-integration","__idx":3},"children":["Workflow 1: Set Up the Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A Treasure AI admin provisions the account's resources and grants access, then works with the warehouse admin to connect Databricks. The workflow ends by reading a sample table from Databricks, so the integration is validated before any real data is published."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Step"},"children":["Step"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Where"},"children":["Where"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Action"},"children":["Action"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provision the account's catalog resources"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Grant write access to publishing users"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create a sample table from Data Workbench"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Databricks + Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Federate the catalog into Unity Catalog and register Databricks in the trust policy"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Databricks"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read the sample table to validate the integration"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-treasure-ai-provision-resources","__idx":4},"children":["Step 1 (Treasure AI): Provision Resources"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Provisioning creates the S3 bucket, the default export database, and the reader IAM role. It is a one-time, asynchronous operation."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start provisioning:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api-iceberg-mng.us01.treasuredata.com/v1/iceberg/catalog/resources\" \\\n  -H \"Authorization: TD1 <admin_api_key>\" \\\n  -H \"Accept: application/json\"\n","lang":"sh"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Poll until ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," becomes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]}," (typically 1–2 minutes):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"curl \"https://api-iceberg-mng.us01.treasuredata.com/v1/iceberg/catalog/resources\" \\\n  -H \"Authorization: TD1 <admin_api_key>\" \\\n  -H \"Accept: application/json\"\n","lang":"sh"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["From the response, record ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aws_region"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aws_account_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["iam_role_arn"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_location_url"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["db_name"]}," (for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td10000_us01_export"]},") — Step 4 uses all five values."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the status becomes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]},", retry the POST request. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/resource-provisioning"},"children":["Provision Resources"]}," for status semantics and error responses."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-treasure-ai-grant-write-access-to-publishers","__idx":5},"children":["Step 2 (Treasure AI): Grant Write Access to Publishers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Users have no access to the Iceberg catalog until an admin grants it. Grant the data engineer who will publish tables ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FULL"]}," access to the export database:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"curl -X PUT \"https://api-iceberg-mng.us01.treasuredata.com/v1/iceberg/catalog/permissions\" \\\n  -H \"Authorization: TD1 <admin_api_key>\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"user_id\": 12345,\n    \"permissions\": [\n      {\n        \"resource_type\": \"DATABASE\",\n        \"resource_names\": [\"td10000_us01_export\"],\n        \"operation\": \"FULL\"\n      }\n    ]\n  }'\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["12345"]}," with the user's ID (find it with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/td-api/user-api#get-userlist"},"children":["get user list API"]},") and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td10000_us01_export"]}," with your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["db_name"]},". To grant your own user — for example, to run Step 3 yourself — omit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_id"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The endpoint replaces the user's entire permission list, and finer-grained operations (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["READ"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WRITE"]},") are available. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/permission-management"},"children":["Database-Level Access Control for Iceberg Catalog"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-treasure-ai-create-a-sample-table","__idx":6},"children":["Step 3 (Treasure AI): Create a Sample Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A table must exist before the Databricks connection can be verified end to end. As a user granted access in Step 2, run a Trino query in Data Workbench:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE TABLE iceberg.td10000_us01_export.sample_products AS\nSELECT * FROM (VALUES (1, 'apple'), (2, 'banana')) AS t(id, name);\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm the table is readable:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT * FROM iceberg.td10000_us01_export.sample_products;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The query returns 2 rows. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/iceberg-tables-data-workbench"},"children":["Reading and Writing Iceberg Tables from Data Workbench"]}," for the table naming convention and supported SQL commands."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-databricks--treasure-ai-connect-databricks","__idx":7},"children":["Step 4 (Databricks + Treasure AI): Connect Databricks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The warehouse admin federates the Treasure AI catalog into Unity Catalog, and the Treasure AI admin allows Databricks to assume the reader role. The full procedure with links to the Databricks documentation for each sub-step is in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/databricks-integration"},"children":["Integrate with Databricks"]},"; the essential steps are:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Databricks, create a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["service credential"]}," and a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["storage credential"]},", both pointing at the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["iam_role_arn"]}," recorded in Step 1. Record the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["External ID"]}," that Databricks displays."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Treasure AI, register Databricks in the reader role trust policy, with the Unity Catalog IAM role, the reader role itself (required for self-assumption), and the External ID from the previous step:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api-iceberg-mng.us01.treasuredata.com/v1/iceberg/catalog/resources/reader_role/trust_policy\" \\\n  -H \"Authorization: TD1 <admin_api_key>\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"entries\": [\n      {\n        \"service\": \"databricks\",\n        \"iam_principal_arns\": [\n          \"arn:aws:iam::414351767826:role/unity-catalog-prod-UCMasterRole-14S5ZJVKOTYTL\",\n          \"<iam_role_arn>\"\n        ],\n        \"external_ids\": [\"<external_id_from_databricks>\"]\n      }\n    ]\n  }'\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The update applies asynchronously — poll the resource status endpoint (Step 1) and wait for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," to return to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Important"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The update replaces the entire trust policy. If your account already has an integration (for example Snowflake), include its existing entry in the request, or it loses access. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/trust-policy-management"},"children":["Manage the Reader Role Trust Policy"]},"."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Databricks, create an ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["external location"]}," for the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_location_url"]}," recorded in Step 1, using the storage credential from the first sub-step. Databricks may warn about missing \"Write\" or \"File Events Read\" permissions — the reader role is read-only by design, so force-create the location."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Databricks, create a second storage credential and external location in your own AWS account for Databricks to store its metadata. This location is internal to Databricks and does not hold your table data."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Databricks, create a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["connection"]}," to the Treasure AI catalog (using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aws_region"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aws_account_id"]},", and the service credential) and a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["foreign catalog"]}," — this tutorial names it ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["treasure_ai"]}," — with the location from sub-step 3 as its authorized path and the location from sub-step 4 as its storage location."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The foreign catalog appears in the Databricks Catalog Explorer with the export database inside it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-5-databricks-read-the-sample-table","__idx":8},"children":["Step 5 (Databricks): Read the Sample Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In a Databricks notebook or the SQL editor, query the sample table through the foreign catalog:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT * FROM treasure_ai.td10000_us01_export.sample_products;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The query returns the 2 rows created in Step 3. The integration is now validated end to end, and setup is complete. You can drop the sample table from Data Workbench (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DROP TABLE iceberg.td10000_us01_export.sample_products"]},") once real tables are published."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"workflow-2-publish-data","__idx":9},"children":["Workflow 2: Publish Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A data engineer with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WRITE"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FULL"]}," access to the export database publishes data by writing Iceberg tables to it. Anything the warehouse should see — a refreshed segment, a new dataset — is one Trino query away; the Databricks side needs no changes."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Step"},"children":["Step"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Where"},"children":["Where"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Action"},"children":["Action"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stage a table into the export database"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Databricks"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read the new table through the foreign catalog"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refresh the data on a schedule"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Drop the table to unpublish it"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-treasure-ai-stage-a-table","__idx":10},"children":["Step 1 (Treasure AI): Stage a Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Copy data from a Data Workbench table into the export database with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CREATE TABLE AS SELECT"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE TABLE iceberg.td10000_us01_export.customer_segments AS\nSELECT * FROM my_database.customer_segments;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-databricks-read-the-new-table","__idx":11},"children":["Step 2 (Databricks): Read the New Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["New tables in the export database appear in the foreign catalog automatically — no reconfiguration on the Databricks side:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT * FROM treasure_ai.td10000_us01_export.customer_segments LIMIT 100;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-treasure-ai-keep-the-data-fresh","__idx":12},"children":["Step 3 (Treasure AI): Keep the Data Fresh"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Databricks reads the table's current state on every query, so refreshing the data in Treasure AI is all that is needed. Choose a refresh pattern:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append new rows"]}," incrementally, for example the last day of events:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"INSERT INTO iceberg.td10000_us01_export.customer_segments\nSELECT * FROM my_database.customer_segments\nWHERE td_interval(time, '-1d');\n","lang":"sql"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rewrite changed rows"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPDATE"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DELETE"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MERGE"]},", then compact the table (requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FULL"]}," permission):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"ALTER TABLE iceberg.td10000_us01_export.customer_segments EXECUTE optimize;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Trino writes row-level changes as Iceberg position delete files, which Databricks does not support — until the table is optimized, it may not be readable from Databricks. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/iceberg-tables-data-workbench#dml-data-manipulation-language"},"children":["DML compatibility warning"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To refresh on a recurring basis, run the query as a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/scheduled/scheduling-a-query"},"children":["scheduled query"]}," in Data Workbench."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-treasure-ai-unpublish-a-table","__idx":13},"children":["Step 4 (Treasure AI): Unpublish a Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To stop publishing a dataset, drop its table (requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FULL"]}," permission):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"DROP TABLE iceberg.td10000_us01_export.customer_segments;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The table and its data are deleted, and it disappears from the foreign catalog."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":14},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Organize published data into multiple databases with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/database-management"},"children":["Database Management API"]}," — new databases are accessible through the foreign catalog without additional configuration"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fine-tune who can read and write each database with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/permission-management"},"children":["Database-Level Access Control for Iceberg Catalog"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Connect additional warehouses: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/snowflake-integration"},"children":["Snowflake"]}," or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/bigquery-integration"},"children":["BigQuery"]},", adding their trust policy entries with the read-modify-write flow in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/trust-policy-management"},"children":["Manage the Reader Role Trust Policy"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Review the full SQL command support and restrictions in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/composable-publish/iceberg-tables-data-workbench"},"children":["Reading and Writing Iceberg Tables from Data Workbench"]}]}]}]},"headings":[{"value":"Composable Publish Tutorial","id":"composable-publish-tutorial","depth":1},{"value":"How Composable Publish Works","id":"how-composable-publish-works","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Workflow 1: Set Up the Integration","id":"workflow-1-set-up-the-integration","depth":2},{"value":"Step 1 (Treasure AI): Provision Resources","id":"step-1-treasure-ai-provision-resources","depth":3},{"value":"Step 2 (Treasure AI): Grant Write Access to Publishers","id":"step-2-treasure-ai-grant-write-access-to-publishers","depth":3},{"value":"Step 3 (Treasure AI): Create a Sample Table","id":"step-3-treasure-ai-create-a-sample-table","depth":3},{"value":"Step 4 (Databricks + Treasure AI): Connect Databricks","id":"step-4-databricks--treasure-ai-connect-databricks","depth":3},{"value":"Step 5 (Databricks): Read the Sample Table","id":"step-5-databricks-read-the-sample-table","depth":3},{"value":"Workflow 2: Publish Data","id":"workflow-2-publish-data","depth":2},{"value":"Step 1 (Treasure AI): Stage a Table","id":"step-1-treasure-ai-stage-a-table","depth":3},{"value":"Step 2 (Databricks): Read the New Table","id":"step-2-databricks-read-the-new-table","depth":3},{"value":"Step 3 (Treasure AI): Keep the Data Fresh","id":"step-3-treasure-ai-keep-the-data-fresh","depth":3},{"value":"Step 4 (Treasure AI): Unpublish a Table","id":"step-4-treasure-ai-unpublish-a-table","depth":3},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Composable Publish Tutorial: Publish Data to Databricks","description":"Set up Composable Publish end to end — provision Iceberg catalog resources, connect Databricks, and publish Treasure AI tables for zero-copy reads."}},"lastModified":"2026-08-03T05:30:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/composable-publish/tutorial","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}