metadata-ingestion/docs/sources/looker/lookml_post.md
Use the Important Capabilities table above as the source of truth for supported features and whether additional configuration is required.
When use_api_for_view_lineage: true is enabled, DataHub uses the LookerQueryAPIBasedViewUpstream implementation to extract lineage. This approach:
Uses SQL from Looker API: The system queries the Looker API to generate fully resolved SQL statements for views, which are then parsed to extract column-level and table-level lineage. This provides more accurate lineage than regex-based parsing.
Works Only for Reachable Views: The Looker Query API requires an explore name to generate SQL queries. Therefore, this method only works for views that are reachable from explores defined in your LookML model files. A view is considered "reachable" if it is referenced by at least one explore (either directly or through joins).
Fallback Behavior: Views that are not reachable from any explore cannot use the API-based approach and will automatically fall back to regex-based parsing. If emit_reachable_views_only: true (default), unreachable views are skipped entirely.
Example:
source:
type: lookml
config:
# Enable API-based lineage (requires reachable views)
use_api_for_view_lineage: true
# Control whether unreachable views are processed
# If true (default), only views referenced by explores are processed
# If false, all views are processed, but unreachable ones use regex parsing
emit_reachable_views_only: true
When a view is not reachable:
emit_reachable_views_only: true: The view is skipped and a warning is loggedemit_reachable_views_only: false: The view is processed using regex-based parsing (may have limited lineage accuracy)Handling Liquid Templates
If a view contains a liquid template, for example:
sql_table_name: {{ user_attributes['db'] }}.kafka_streaming.events
where db=ANALYTICS_PROD, you need to specify the values of those variables in the liquid_variables configuration as shown below:
liquid_variables:
user_attributes:
db: ANALYTICS_PROD
Resolving LookML Constants
If a view contains a LookML constant, for example:
sql_table_name: @{db}.kafka_streaming.events;
Ingestion attempts to resolve it's value by looking at project manifest files
manifest.lkml
constant: db {
value: "ANALYTICS_PROD"
}
If the constant's value is not resolved or incorrectly resolved, you can specify lookml_constants configuration in ingestion recipe as shown below. The constant value in recipe takes precedence over constant values resolved from manifest.
```yml
lookml_constants:
db: ANALYTICS_PROD
```
Limitations:
{{ var }}) and condition directives ({% condition filter_name %} field {% endcondition %})if/else/endif and custom Looker tags like date_start, date_end, and parameterAdditional Notes
Important: Unsupported templates may cause lineage extraction to fail for some assets.
Although liquid variables and LookML constants can be used anywhere in LookML code, their values are currently resolved only for LookML views by DataHub LookML ingestion. This behavior is sufficient since LookML ingestion processes only views and their upstream dependencies.
Looker projects support organization as multiple git repos, with remote includes that can refer to projects that are stored in a different repo. If your Looker implementation uses multi-project setup, you can configure the LookML source to pull in metadata from your remote projects as well.
If you are using local or remote dependencies, you will see include directives in your lookml files that look like this:
include: "//e_flights/views/users.view.lkml"
include: "//e_commerce/public/orders.view.lkml"
Also, you will see projects that are being referred to listed in your manifest.lkml file. Something like this:
project_name: this_project
local_dependency: {
project: "my-remote-project"
}
remote_dependency: ga_360_block {
url: "https://github.com/llooker/google_ga360"
ref: "0bbbef5d8080e88ade2747230b7ed62418437c21"
}
To ingest Looker repositories that are including files defined in other projects, you will need to use the project_dependencies directive within the configuration section.
Consider the following scenario:
my_remote_projectmy_org/my_remote_project${MY_REMOTE_PROJECT_DEPLOY_KEY}In this case, you can add this section to your recipe to activate multi-project LookML ingestion.
source:
type: lookml
config:
... other config variables
project_dependencies:
my_remote_project:
repo: my_org/my_remote_project
deploy_key: ${MY_REMOTE_PROJECT_DEPLOY_KEY}
Under the hood, DataHub will check out your remote repository using the provisioned deploy key, and use it to navigate includes that you have in the model files from your primary project.
If you have the remote project checked out locally, and do not need DataHub to clone the project for you, you can provide DataHub directly with the path to the project like the config snippet below:
source:
type: lookml
config:
... other config variables
project_dependencies:
my_remote_project: /path/to/local_git_clone_of_remote_project
:::note
This is not the same as ingesting the remote project as a primary Looker project because DataHub will not be processing the model files that might live in the remote project. If you want to additionally include the views accessible via the models in the remote project, create a second recipe where your remote project is the primary project.
:::
For Looker views with a large number of fields (100+), DataHub automatically uses field splitting to ensure reliable lineage extraction. This feature splits large field sets into manageable chunks, processes them in parallel, and combines the results.
:::important
API Configuration Required: Field splitting requires Looker API credentials to be configured. You must:
api configuration section with your Looker credentialsuse_api_for_view_lineage: true to enable API-based lineage extractionWithout API configuration, field splitting will not be available and the system will fall back to regex-based parsing, which may fail for large views.
Reachable Views Only: The LookerQueryAPIBasedViewUpstream implementation (used for field splitting) works by querying the Looker API to generate SQL statements for views. This approach only works for reachable views - views that are referenced by explores defined in your LookML model files. Views that are not reachable from any explore cannot be queried via the Looker API and will fall back to regex-based parsing. The emit_reachable_views_only configuration option controls whether only reachable views are processed.
:::
Field splitting is automatically triggered when:
use_api_for_view_lineage: true is setYou can adjust this threshold based on your needs:
source:
type: lookml
config:
# Adjust the threshold for field splitting (default: 100)
field_threshold_for_splitting: 100
When to adjust the threshold:
By default, DataHub will return partial lineage results even if some field chunks fail to parse. This ensures you get lineage information for working fields rather than complete failure.
source:
type: lookml
config:
# Allow partial lineage when some chunks fail (default: true)
allow_partial_lineage_results: true
When to disable:
false if you want strict validation and prefer complete failure over partial resultsWhen a chunk of fields fails, DataHub can automatically attempt to process each field individually. This helps:
source:
type: lookml
config:
# Enable individual field processing when chunks fail (default: true)
enable_individual_field_fallback: true
When to disable:
false if you want faster processing and don't need to identify problematic fieldsField chunks are processed in parallel to improve performance. You can control the number of worker threads:
source:
type: lookml
config:
# Number of parallel workers (default: 10, max: 100)
max_workers_for_parallel_processing: 10
Performance tuning:
Important: The maximum allowed value is 100 to prevent resource exhaustion. Values above 100 will be automatically capped with a warning.
Here's a complete example configuration for handling large views:
source:
type: lookml
config:
base_folder: /path/to/lookml
# API configuration (REQUIRED for field splitting)
api:
base_url: "https://your-instance.cloud.looker.com"
client_id: ${LOOKER_CLIENT_ID}
client_secret: ${LOOKER_CLIENT_SECRET}
# Enable API-based lineage extraction (REQUIRED for field splitting)
use_api_for_view_lineage: true
# Optional: Enable API caching for better performance
use_api_cache_for_view_lineage: true
# Large view handling configuration
field_threshold_for_splitting: 100 # Split views with >100 fields
allow_partial_lineage_results: true # Return partial results on errors
enable_individual_field_fallback: true # Process fields individually on chunk failure
max_workers_for_parallel_processing: 10 # Parallel processing workers
Important Notes:
api section with credentials is required for field splitting to workuse_api_for_view_lineage: true must be set to enable API-based lineage extractionLookerQueryAPIBasedViewUpstream only works for views that are reachable from explores. The Looker Query API requires an explore name to generate SQL, so views not referenced by any explore will use regex-based parsing insteademit_reachable_views_only configuration (default: true) controls whether unreachable views are processed at allCheck ingestion logs for:
View 'view_name' has X fields, exceeding threshold of Y. Splitting into multiple queriesCombined results for view 'view_name': X tables, Y column lineages, success rate: Z%Common issues:
use_api_for_view_lineage: true and API credentials are configuredfield_threshold_for_splitting or investigating problematic fieldsmax_workers_for_parallel_processing to decrease concurrent requestsmax_workers_for_parallel_processing if you experience memory pressureModule behavior is constrained by source APIs, permissions, and metadata exposed by the platform. Refer to capability notes for unsupported or conditional features.
If you have Looker views with many fields (100+) and are experiencing lineage extraction issues, the following troubleshooting steps can help:
:::important
Prerequisites: Field splitting requires Looker API configuration. Ensure you have:
api section with valid credentials configureduse_api_for_view_lineage: true enabled:::
Symptoms:
Solutions:
Verify API configuration:
source:
type: lookml
config:
api:
base_url: "https://your-instance.cloud.looker.com"
client_id: ${LOOKER_CLIENT_ID}
client_secret: ${LOOKER_CLIENT_SECRET}
use_api_for_view_lineage: true # Must be enabled
Check API credentials:
Verify view-to-explore mapping:
emit_reachable_views_only: true (default), unreachable views are skipped entirelySymptoms:
Solutions:
Verify field splitting is working: Check your ingestion logs for messages like:
View 'your_view' has 150 fields, exceeding threshold of 100. Splitting into multiple queries for partial lineage.
If you don't see this message, field splitting may not be triggered. Lower the threshold:
field_threshold_for_splitting: 50 # Lower threshold
Check success rates: Look for statistics in logs:
Combined results for view 'your_view': 5 tables, 120 column lineages, success rate: 80.0%
Enable individual field fallback: If chunks are failing, enable individual field processing to identify problematic fields:
enable_individual_field_fallback: true
Check logs for warnings about specific fields that fail.
Adjust parallel processing: If you're hitting API rate limits, reduce workers:
max_workers_for_parallel_processing: 5 # Reduce from default 10
Symptoms:
Solutions:
Increase parallel workers:
max_workers_for_parallel_processing: 20 # Increase from default 10
Note: Monitor system resources and API rate limits
Enable API caching:
use_api_cache_for_view_lineage: true # Enable server-side caching
Verify parallel processing is active:
Check logs for concurrent processing indicators. If processing appears sequential, verify max_workers_for_parallel_processing is set correctly.
Symptoms:
Solutions:
Reduce parallel workers:
max_workers_for_parallel_processing: 5 # Reduce concurrent processing
Process sequentially:
max_workers_for_parallel_processing: 1 # Disable parallel processing
Increase chunk size:
field_threshold_for_splitting: 150 # Larger chunks = fewer concurrent operations
Symptoms:
Solutions:
This is expected behavior when allow_partial_lineage_results: true (default)
To identify problematic fields:
enable_individual_field_fallback: true (default)For strict validation:
allow_partial_lineage_results: false # Fail completely if any chunk fails
Note: This may result in no lineage for large views if any chunk fails
max_workers_for_parallel_processingmax_workers_for_parallel_processingenable_individual_field_fallbackallow_partial_lineage_resultsIf you see messages like my_file.view.lkml': "failed to load view file: Unable to find a matching expression for '<literal>' on line 5" in the failure logs, it indicates a parsing error for the LookML file.
The first thing to check is that the Looker IDE can validate the file without issues. You can check this by clicking this "Validate LookML" button in the IDE when in development mode.
If that's not the issue, it might be because DataHub's parser, which is based on the joshtemple/lkml library, is slightly more strict than the official Looker parser. Note that there's currently only one known discrepancy between the two parsers, and it's related to using leading colons in blocks.
To check if DataHub can parse your LookML file syntax, you can use the lkml CLI tool. If this raises an exception, DataHub will fail to parse the file.
pip install lkml
lkml path/to/my_file.view.lkml