|
| 1 | +--- |
| 2 | +# frontmatter |
| 3 | +path: "/tutorial-looker-studio-columnar" |
| 4 | +# title and description do not need to be added to markdown, start with H2 (##) |
| 5 | +title: Connect Looker Studio to Couchbase Columnar using Views and Custom Queries |
| 6 | +short_title: Columnar Looker Studio Connector |
| 7 | +description: |
| 8 | + - Connect Google Looker Studio to Couchbase Columnar using Tabular Analytics Views (TAVs) or custom queries |
| 9 | + - Create Tabular Analytics Views in Capella for stable datasets or use custom SQL++ queries for flexibility |
| 10 | + - Learn authentication, configuration, schema inference, and troubleshooting |
| 11 | +content_type: tutorial |
| 12 | +filter: connectors |
| 13 | +technology: |
| 14 | + - server |
| 15 | + - query |
| 16 | +tags: |
| 17 | + - Looker Studio |
| 18 | + - Couchbase Columnar |
| 19 | + - Connector |
| 20 | + - TAVs |
| 21 | + - Custom Queries |
| 22 | +sdk_language: |
| 23 | + - nodejs |
| 24 | +length: 20 Mins |
| 25 | +--- |
| 26 | + |
| 27 | +<!-- [abstract] --> |
| 28 | + |
| 29 | +## Overview |
| 30 | + |
| 31 | +Connect Looker Studio to Couchbase Columnar for data analysis and visualization. This connector supports two modes: Tabular Analytics Views (TAVs) for stable, optimized data sources, and custom queries for flexible data exploration. |
| 32 | + |
| 33 | +**Workflow**: Either create TAVs in Couchbase Capella for consistent reporting, or use custom SQL++ queries for ad-hoc analysis. TAVs provide a stable, schema-defined interface that's optimized for BI tools, while custom queries offer maximum flexibility for complex data operations. |
| 34 | + |
| 35 | +The connector authenticates with Basic Auth to the Columnar API (`/api/v1/request`) and infers schema automatically using `array_infer_schema` so Looker Studio fields are created with reasonable types. |
| 36 | + |
| 37 | +## Prerequisites |
| 38 | + |
| 39 | +To use this connector, you need: |
| 40 | + |
| 41 | +### Couchbase Columnar Access |
| 42 | +- **Sign up**: Visit [Couchbase Capella](https://cloud.couchbase.com/) to create your account |
| 43 | +- **Free Trial**: Start with a free trial to test the connector |
| 44 | +- **Columnar Service**: Enable Columnar analytics in your Capella cluster |
| 45 | +- **Pricing**: Columnar is billed based on compute and storage usage. See [Capella Pricing](https://www.couchbase.com/pricing/capella/) for details |
| 46 | + |
| 47 | +### Technical Requirements |
| 48 | +- A Couchbase Columnar deployment reachable from Looker Studio. For setup information, see [Getting Started with Couchbase Columnar](https://www.couchbase.com/products/analytics/). |
| 49 | +- A database user with permissions to read from the target Tabular Analytics Views (TAVs) and execute queries. |
| 50 | +- Network access from Looker Studio to your Columnar host. |
| 51 | + |
| 52 | +## Installation |
| 53 | + |
| 54 | +To add the Couchbase Columnar connector to your Looker Studio reports: |
| 55 | + |
| 56 | +1. **Open Looker Studio**: Go to [Looker Studio](https://lookerstudio.google.com/) |
| 57 | +2. **Create or Open Report**: Start a new report or open an existing one |
| 58 | +3. **Add Data Source**: Click "Add data" or the "+" button |
| 59 | +4. **Find Connector**: Search for "Couchbase Columnar" in the connector gallery |
| 60 | +5. **Authorize**: Grant necessary permissions when prompted |
| 61 | +6. **Configure**: Follow the authentication and configuration steps below |
| 62 | + |
| 63 | +## Authentication |
| 64 | + |
| 65 | +When adding the data source, provide: |
| 66 | + |
| 67 | +- Path: The Columnar host. Example: |
| 68 | + - Capella host: `cb.<your-host>.cloud.couchbase.com` |
| 69 | +- Username and Password: Database credentials. |
| 70 | + |
| 71 | +The connector validates credentials by running a lightweight test query (`SELECT 1 AS test;`). |
| 72 | + |
| 73 | +When you add the Couchbase Columnar connector in Looker Studio, you'll see the authentication screen: |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +## Create Tabular Analytics Views (TAVs) in Capella (Recommended) |
| 78 | + |
| 79 | +For the "By View" mode, create Tabular Analytics Views in Capella: |
| 80 | + |
| 81 | +1. **Open Analytics Workbench**: In your Capella cluster, go to the Analytics tab and launch the Analytics Workbench. |
| 82 | + |
| 83 | +2. **Create your SQL++ query**: Write a query that returns the data structure you want for reporting: |
| 84 | + |
| 85 | +```sql |
| 86 | +-- Example airport query for TAV creation |
| 87 | +SELECT a.airportname, |
| 88 | + a.city, |
| 89 | + a.country, |
| 90 | + a.faa, |
| 91 | + a.icao |
| 92 | +FROM `travel-sample`.`inventory`.`airport` AS a |
| 93 | +WHERE a.country = 'United States' |
| 94 | +LIMIT 100; |
| 95 | +``` |
| 96 | + |
| 97 | +3. **Test the query**: Run your query to verify it returns the expected results and data types. |
| 98 | + |
| 99 | +4. **Create the TAV**: |
| 100 | + - Click **Save as View** in the Analytics Workbench |
| 101 | + - Select **Annotate for Tabular View** |
| 102 | + - **Define the schema**: Specify column names, data types (STRING, NUMBER, BOOLEAN), and mark primary key fields |
| 103 | + - **Name your view**: Use a descriptive name like `airports_us_flattened` |
| 104 | + - **Save**: The TAV will be created with enforced schema |
| 105 | + |
| 106 | +5. **Verify creation**: Your TAV will appear in the database browser under the specified scope and can be queried like a table. |
| 107 | + |
| 108 | +- For details, see [Tabular Analytics Views](https://docs.couchbase.com/columnar/query/views-tavs.html) and [Buckets, Scopes, and Collections](https://docs.couchbase.com/cloud/clusters/data-service/about-buckets-scopes-collections.html). |
| 109 | + |
| 110 | +## Configuration |
| 111 | + |
| 112 | +Choose your mode in the configuration screen: |
| 113 | + |
| 114 | +- Configuration Mode: Choose between `By View` or `Use Custom Query`. |
| 115 | + |
| 116 | +### Mode: By View (TAV) |
| 117 | + |
| 118 | +- Couchbase Database, Scope, View: Selected from dropdowns that automatically discover your available databases, scopes, and views from your Columnar instance. |
| 119 | +- Maximum Rows: Optional limit for returned rows; leave blank for no limit. |
| 120 | + |
| 121 | +What runs: |
| 122 | + |
| 123 | +- Data: `SELECT <requested fields or *> FROM \`database\`.\`scope\`.\`view\` [LIMIT n]` |
| 124 | +- Schema: `SELECT array_infer_schema((SELECT VALUE t FROM \`database\`.\`scope\`.\`view\` [LIMIT n])) AS inferred_schema;` |
| 125 | + |
| 126 | +### Mode: By Custom Query |
| 127 | + |
| 128 | +- Custom Columnar Query: Enter your own SQL++ query directly in a text area. |
| 129 | +- Maximum Rows: Not applicable (control limits within your query using `LIMIT`). |
| 130 | + |
| 131 | +**Example custom query**: |
| 132 | +```sql |
| 133 | +SELECT airline.name AS airline_name, |
| 134 | + airline.iata AS iata_code, |
| 135 | + airline.country AS country, |
| 136 | + COUNT(*) AS route_count |
| 137 | +FROM `travel-sample`.`inventory`.`airline` AS airline |
| 138 | +JOIN `travel-sample`.`inventory`.`route` AS route |
| 139 | + ON airline.iata = route.airline |
| 140 | +WHERE airline.country = "United States" |
| 141 | +GROUP BY airline.name, airline.iata, airline.country |
| 142 | +LIMIT 100; |
| 143 | +``` |
| 144 | + |
| 145 | +What runs: |
| 146 | +- Data: Your exact custom query as entered |
| 147 | +- Schema: `SELECT array_infer_schema((your_custom_query)) AS inferred_schema;` |
| 148 | + |
| 149 | +After authentication, configure the connector by selecting your database, scope, and view: |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +## Schema and Field Types |
| 154 | + |
| 155 | +- The connector converts inferred types to Looker types: |
| 156 | + - number → NUMBER (metric) |
| 157 | + - boolean → BOOLEAN (dimension) |
| 158 | + - string/objects/arrays/null → STRING/TEXT (dimension) |
| 159 | +- Nested fields are flattened using dot and array index notation where possible (for example, `address.city`, `schedule[0].day`). Unstructured values may be stringified. |
| 160 | + |
| 161 | +> **⚠️ Schema Inference Notes**: For TAVs, schema inference uses `array_infer_schema` on the entire dataset unless you specify Maximum Rows (which adds a LIMIT clause for sampling). Field types are inferred from the analyzed data and may miss variations (e.g., fields containing both text and numbers in different documents). If schema inference fails, ensure your TAV contains data and consider adding a Maximum Rows limit for faster sampling during testing. |
| 162 | +
|
| 163 | +Once your schema is configured, you can customize the fields in your Looker Studio dashboard: |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | +## Data Retrieval |
| 168 | + |
| 169 | +- Only requested fields are projected. For nested fields, the connector fetches the required base fields and extracts values server-side within the Apps Script environment. |
| 170 | +- Row limits: |
| 171 | + - View mode: `Maximum Rows` controls `LIMIT` (blank = no limit). |
| 172 | + |
| 173 | +## Tips and Best Practices |
| 174 | + |
| 175 | +- **Prefer Tabular Analytics Views for BI tooling**: TAVs provide a stable, optimized interface with predefined schemas, making them ideal for consistent reporting and visualization. They also offer better performance than ad-hoc queries. |
| 176 | +- **Use `LIMIT` while exploring**: Start with smaller datasets (e.g., `LIMIT 1000`) to test connectivity and schema inference quickly. Remove or increase limits once you're satisfied with the data structure. |
| 177 | + |
| 178 | +## Troubleshooting |
| 179 | + |
| 180 | +- **Authentication failure**: Check host, credentials, and network reachability to Columnar. |
| 181 | +- **Schema inference errors**: Ensure your TAV exists and contains data. Try adding a `LIMIT` clause for faster sampling (e.g., `LIMIT 100`). |
| 182 | +- **API error from Columnar**: Review the response message in Looker Studio and verify TAV names, permissions, and that the view is properly created in Capella. |
| 183 | +- **Empty or missing TAV**: Verify that your Tabular Analytics View was saved correctly in the Analytics Workbench and contains data. |
| 184 | +- **Schema mismatch**: If fields appear with unexpected types, verify your TAV schema definition matches your query results. TAVs enforce schema consistency, so ensure your query produces data that matches the defined column types. |
| 185 | + |
| 186 | +## Next Steps |
| 187 | + |
| 188 | +Once your connector is configured and fields are set up, create reports by dragging and dropping tables from the side pane onto the main canvas: |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | +- Build charts in Looker Studio using your TAV-backed fields. |
| 193 | +- Iterate on Views/queries to shape the dataset for analytics. |
| 194 | +- Explore the rich visualization options available in Looker Studio to create compelling dashboards from your Columnar data. |
| 195 | + |
| 196 | +## Support |
| 197 | + |
| 198 | +For assistance with the Couchbase Columnar Looker Studio connector: |
| 199 | + |
| 200 | +### Technical Support |
| 201 | +- **Documentation**: Complete guides at [Couchbase Developer Portal](https://developer.couchbase.com/) |
| 202 | +- **Community Forum**: Get help from the community at [Couchbase Forums](https://forums.couchbase.com/) |
| 203 | +- **Developer Community**: Connect with [Couchbase Developer Community](https://www.couchbase.com/developers/community/) |
| 204 | +- **Discord**: Join real-time discussions on [Couchbase Discord](https://discord.gg/sQ5qbPZuTh) |
| 205 | + |
| 206 | +### Issue Reporting |
| 207 | +- **Connector Issues**: Report bugs or feature requests through [Couchbase Support](https://support.couchbase.com/hc/en-us) |
| 208 | +- **General Contact**: For other inquiries, use [Couchbase Contact](https://www.couchbase.com/contact/) |
| 209 | +- **Response Time**: We aim to respond to connector issues within 2-3 business days |
| 210 | +- **Known Limitations**: Check the troubleshooting section above for common issues |
| 211 | + |
| 212 | +### Resources |
| 213 | +- **Couchbase Columnar Documentation**: [Official Docs](https://docs.couchbase.com/columnar/intro/intro.html) |
| 214 | +- **Looker Studio Help**: [Google Looker Studio Support](https://support.google.com/looker-studio/) |
| 215 | +- **Sample Data**: Use travel-sample bucket for testing and examples |
| 216 | +- **API Documentation**: [Columnar Management API](https://docs.couchbase.com/columnar/management-api-guide/management-api-intro.html) |
| 217 | + |
| 218 | +## Privacy Policy |
| 219 | + |
| 220 | +**Connector Data Usage**: This connector accesses your Couchbase Columnar credentials and query results solely for data integration with Looker Studio. No data is stored permanently by the connector, and all processing occurs within Google's Looker Studio environment. |
| 221 | + |
| 222 | +**Official Privacy Policy**: For complete information about how Couchbase handles your data, please review our official [Couchbase Privacy Policy](https://www.couchbase.com/privacy-policy/). |
| 223 | + |
| 224 | +**Google Looker Studio**: This connector operates within Google Looker Studio, which has its own data handling policies. Please review [Google's Privacy Policy](https://policies.google.com/privacy) for their data practices. |
| 225 | + |
| 226 | +## Terms of Service |
| 227 | + |
| 228 | +**Connector Usage**: Use this connector only with Couchbase Columnar instances you own or have permission to access. Maintain security of your credentials and comply with your organization's data governance policies. |
| 229 | + |
| 230 | +**Official Terms**: Your use of Couchbase products and services is governed by our official [Couchbase Terms of Use](https://www.couchbase.com/terms-of-use/). For enterprise customers, additional terms may apply under your specific [Couchbase License Agreement](https://www.couchbase.com/legal/agreements/). |
| 231 | + |
| 232 | +**Google Looker Studio**: This connector operates within Google Looker Studio and is subject to [Google's Terms of Service](https://policies.google.com/terms). |
| 233 | + |
| 234 | +## Legal |
| 235 | + |
| 236 | +**Copyright**: © 2024 Couchbase, Inc. All rights reserved. |
| 237 | + |
| 238 | +**Legal Information**: For comprehensive legal information, licensing terms, and trademark policies, visit [Couchbase Legal](https://www.couchbase.com/legal/) and our [Trademark Policy](https://www.couchbase.com/trademark-policy/). |
| 239 | + |
| 240 | +**Trademarks**: Couchbase and the Couchbase logo are trademarks of Couchbase, Inc. Google Looker Studio is a trademark of Google LLC. |
| 241 | + |
| 242 | +**Contact **: For legal inquiries, contact [[email protected]](mailto:[email protected]). |
| 243 | + |
| 244 | + |
0 commit comments