|
| 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: Looker Studio with Couchbase Columnar (Views-only) |
| 6 | +short_title: Columnar (Views-only) |
| 7 | +description: |
| 8 | + - Connect Google Looker Studio to Couchbase Columnar using views only |
| 9 | + - Create views in Capella and use them as stable, optimized datasets |
| 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 | + - Views-only |
| 21 | +sdk_language: |
| 22 | + - javascript |
| 23 | +length: 20 Mins |
| 24 | +--- |
| 25 | + |
| 26 | +<!-- [abstract] --> |
| 27 | + |
| 28 | +## Overview |
| 29 | + |
| 30 | +This is a views-only connector for Google Looker Studio and Couchbase Columnar. It exclusively accesses data through views in Couchbase Capella. Create one or more views first, then connect Looker Studio to those views for analysis. |
| 31 | + |
| 32 | +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. |
| 33 | + |
| 34 | +## Prerequisites |
| 35 | + |
| 36 | +- A Couchbase Columnar deployment reachable from Looker Studio. |
| 37 | +- A database user with permissions to read from the target Views/Collections and execute queries. |
| 38 | +- Network access from Looker Studio to your Columnar host. |
| 39 | + |
| 40 | +## Authentication |
| 41 | + |
| 42 | +When adding the data source, provide: |
| 43 | + |
| 44 | +- Path: The Columnar host (optionally with port). Examples: |
| 45 | + - Capella-style host: `cb.<your-host>.cloud.couchbase.com` |
| 46 | + - Self-managed: `my.host:18095` (port recommended if not 443) |
| 47 | +- Username and Password: Database credentials. |
| 48 | + |
| 49 | +The connector validates credentials by running a lightweight test query (`SELECT 1 AS test;`). |
| 50 | + |
| 51 | +## Create Views in Capella (Required) |
| 52 | + |
| 53 | +Before connecting, create views in Capella Columnar Workbench: |
| 54 | + |
| 55 | +1. Open Capella, navigate to the Columnar tab, and launch the Workbench for your cluster. |
| 56 | +2. Create a view using SQL++: |
| 57 | + |
| 58 | +```sql |
| 59 | +CREATE VIEW my_airports AS |
| 60 | +SELECT airportname, city, country |
| 61 | +FROM `travel-sample`.`inventory`.`airport` |
| 62 | +WHERE country = 'United States'; |
| 63 | +``` |
| 64 | + |
| 65 | +- Replace names as needed. Views are stable datasets optimized for BI. |
| 66 | +- For more, see the Couchbase docs on [Views and Tabular Views](https://docs.couchbase.com/columnar/sqlpp/5a_views.html) and on [Buckets, Scopes, and Collections](https://docs.couchbase.com/cloud/clusters/data-service/about-buckets-scopes-collections.html). |
| 67 | + |
| 68 | +## Configuration |
| 69 | + |
| 70 | +Choose your mode in the configuration screen: |
| 71 | + |
| 72 | +- Configuration Mode: `By View` (views-only connector). |
| 73 | + |
| 74 | +### Mode: By View |
| 75 | + |
| 76 | +- Couchbase Database, Scope, View: Selected from dropdowns populated from metadata. |
| 77 | +- Maximum Rows: Optional limit for returned rows; leave blank for no limit. |
| 78 | + |
| 79 | +What runs: |
| 80 | + |
| 81 | +- Data: `SELECT <requested fields or *> FROM \`database\`.\`scope\`.\`view\` [LIMIT n]` |
| 82 | +- Schema: `SELECT array_infer_schema((SELECT VALUE t FROM \`database\`.\`scope\`.\`view\` [LIMIT n])) AS inferred_schema;` |
| 83 | + |
| 84 | +> Note: This connector does not query collections directly and does not accept custom queries. It reads through views only. |
| 85 | +
|
| 86 | +## Schema and Field Types |
| 87 | + |
| 88 | +- The connector converts inferred types to Looker types: |
| 89 | + - number → NUMBER (metric) |
| 90 | + - boolean → BOOLEAN (dimension) |
| 91 | + - string/objects/arrays/null → STRING/TEXT (dimension) |
| 92 | +- Nested fields are flattened using dot and array index notation where possible (for example, `address.city`, `schedule[0].day`). Unstructured values may be stringified. |
| 93 | + |
| 94 | +## Data Retrieval |
| 95 | + |
| 96 | +- Only requested fields are projected. For nested fields, the connector fetches the required base fields and extracts values client-side. |
| 97 | +- Row limits: |
| 98 | + - View mode: `Maximum Rows` controls `LIMIT` (blank = no limit). |
| 99 | + |
| 100 | +## Tips and Best Practices |
| 101 | + |
| 102 | +- Prefer views for BI tooling; they offer a stable, optimized interface. |
| 103 | +- Keep datasets scoped and use `LIMIT` while exploring. |
| 104 | + |
| 105 | +## Troubleshooting |
| 106 | + |
| 107 | +- Authentication failure: Check host/port, credentials, and network reachability to Columnar. |
| 108 | +- Schema inference errors: Ensure your entity or query returns rows; consider adding `LIMIT` for faster sampling. |
| 109 | +- API error from Columnar: Review the response message surfaced in Looker Studio and verify entity names, permissions, and syntax. |
| 110 | + |
| 111 | +## Future Scope (Prototype) |
| 112 | + |
| 113 | +- Collections and custom query support are in prototype and not available in this views-only connector. As support expands, you’ll be able to query collections directly from Looker Studio in addition to views. |
| 114 | + |
| 115 | +## Next Steps |
| 116 | + |
| 117 | +- Build charts in Looker Studio using your View- or Collection-backed fields. |
| 118 | +- Iterate on Views/queries to shape the dataset for analytics. |
| 119 | + |
| 120 | + |
0 commit comments