Skip to content

Commit 6b7d333

Browse files
fivetran-catfritzfivetran-savagegithub-actions[bot]
authored
bug/string-limit-bq-sf (#193)
* bug/string-limit-bq-sf * fix redshift * redshift and docs * seed for redshift * update seeds for testing * Apply suggestion from @fivetran-savage Co-authored-by: Savage Fivetran <sarah.savage@fivetran.com> * Update CHANGELOG.md * Generate dbt docs via GitHub Actions --------- Co-authored-by: Savage Fivetran <sarah.savage@fivetran.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 020d26c commit 6b7d333

11 files changed

Lines changed: 195 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# dbt_jira v1.10.1
2+
3+
[PR #193](https://github.com/fivetran/dbt_jira/pull/193) includes the following updates:
4+
5+
## Bug Fix
6+
- Fixes a runtime error on Snowflake and BigQuery that occurred when an issue's concatenated comments exceeded the warehouse's string length limit. The `conversation` field in `jira__issue_enhanced` now returns `'conversation too long to render'` for those issues instead of failing the entire run. `count_comments` is unaffected. The character threshold defaults to 16,777,216 (16MB) but can be lowered using the `jira_conversation_char_limit` variable. [See the README for configuration details](https://github.com/fivetran/dbt_jira#controlling-conversation-aggregations-in-jira__issue_enhanced) and the [DECISIONLOG](https://github.com/fivetran/dbt_jira/blob/main/DECISIONLOG.md#conversation-aggregation-guard-against-string-length-limits) for per-warehouse details.
7+
18
# dbt_jira v1.10.0
29

310
[PR #191](https://github.com/fivetran/dbt_jira/pull/191) includes the following updates:
@@ -621,4 +628,4 @@ This release includes the following updates.
621628
- @thibonacci ([#45](https://github.com/fivetran/dbt_jira/pull/45))
622629

623630
# dbt_jira v0.1.0 -> v0.5.1
624-
Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you!
631+
Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you!

DECISIONLOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# Decision Log
22
In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made here, and will continue to update as the package evolves.
33

4+
## Conversation Aggregation Guard Against String Length Limits
5+
Jira issues with a large volume of comments can cause the `conversation` field to exceed the warehouse string size limit, resulting in a runtime error. To prevent this, the package now checks the total conversation length for each issue before aggregation on Snowflake and BigQuery.
6+
7+
If an issue exceeds the configured limit, `conversation` returns `'conversation too long to render'` instead of failing the model. The `count_comments` field is still populated, so users can identify issues with large comment volumes even when the full conversation cannot be rendered.
8+
9+
The default threshold is `16,777,216` characters for Snowflake and BigQuery. You can override this value with `jira_conversation_char_limit` if you need a lower threshold. See the [README](https://github.com/fivetran/dbt_jira#controlling-conversation-aggregations-in-jira__issue_enhanced) for configuration details.
10+
11+
Per-warehouse behavior:
12+
- **Snowflake and BigQuery**: Overflow protection is enabled by default. If an issue has enough comments for `conversation` to exceed the warehouse string size limit, `conversation` returns `'conversation too long to render'` instead of failing. The default limit is `16,777,216` characters.
13+
- **Redshift**: Overflow protection is not currently applied. Redshift has a much lower string size limit, but it does not support the SQL pattern used by this guard, so adding the same protection would require a more significant model change. Conversations are disabled on Redshift by default with `jira_include_conversations`, so overflow is only a risk for users who explicitly enable conversations and have issues with very large comment volumes. If you need Redshift overflow protection, [open a GitHub issue](https://github.com/fivetran/dbt_jira/issues/new/choose).
14+
- **Postgres and Databricks**: Overflow protection is not applied because their string/text limits make this issue unlikely in practice.
15+
416
## Enhancing Jira Sprint Reporting with Flexible Metrics
517
To improve sprint reporting in the Jira dbt package, we introduced two new models, `jira__daily_sprint_issue_history` and `jira__sprint_enhanced`, designed to capture key sprint metrics such as velocity, time tracking, and story point completion.
618

7-
If further refinements or reporting is needed for the sprint report, customers can submit a feature request by clicking the [New Issue button in our package issue page](https://github.com/fivetran/dbt_jira/issues).
19+
If further refinements or reporting is needed for the sprint report, customers can submit a feature request by clicking the [New Issue button in our package issue page](https://github.com/fivetran/dbt_jira/issues).

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,18 @@ vars:
144144
The `dbt_jira` package offers variables to enable or disable conversation aggregations in the `jira__issue_enhanced` table. These settings allow you to manage the amount of data processed and avoid potential performance or limit issues with large datasets.
145145

146146
- `jira_include_conversations`: Controls only the `conversation` [column](https://github.com/fivetran/dbt_jira/blob/main/models/jira.yml#L125-L127) in the `jira__issue_enhanced` table.
147-
- Default: Disabled for Redshift due to string size constraints; enabled for other supported warehouses.
147+
- Default: Disabled for Redshift due to string size constraints; enabled for all other supported warehouses.
148148
- Setting this to `false` removes the `conversation` column but retains the `count_comments` field if `jira_include_comments` is still enabled. This is useful if you want a comment count without the full conversation details.
149+
- On Snowflake and BigQuery, the package automatically guards against string length limit errors. Issues whose aggregated comment text would exceed the warehouse limit return `'conversation too long to render'` instead of failing. The `count_comments` field is unaffected.
150+
151+
- `jira_conversation_char_limit`: Sets the character threshold used on Snowflake and BigQuery to detect conversations that would exceed the warehouse string length limit.
149152

150153
In your `dbt_project.yml` file:
151154

152155
```yml
153156
vars:
154157
jira_include_conversations: false/true # Disabled by default for Redshift; enabled for other supported warehouses.
158+
jira_conversation_char_limit: 16777216 # Override the default character limit for conversation aggregation.
155159
```
156160
157161
#### Controlling team-level granularity in `jira__sprint_enhanced`

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'jira'
2-
version: '1.10.0'
2+
version: '1.10.1'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<3.0.0"]
55

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/ci/test_scenarios.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ test_scenarios:
2727
jira_field_grain: 'field_name'
2828
include_incremental: true
2929

30+
# Redshift is false by default
31+
- name: "conversations disabled"
32+
vars:
33+
jira_include_conversations: false
34+
include_incremental: false
35+
warehouses: ["snowflake", "bigquery", "postgres", "databricks"]
36+
3037
- name: "MDLS"
3138
vars:
3239
fivetran_using_source_casing: true

integration_tests/dbt_project.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'jira_integration_tests'
2-
version: '1.10.0'
2+
version: '1.10.1'
33
config-version: 2
44
profile: 'integration_tests'
55

@@ -49,6 +49,15 @@ seeds:
4949
+column_types:
5050
_fivetran_synced: timestamp
5151
comment:
52+
+enabled: "{{ target.type != 'redshift' }}"
53+
+column_types:
54+
id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
55+
created: timestamp
56+
issue_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
57+
updated: timestamp
58+
comment_redshift:
59+
+enabled: "{{ target.type == 'redshift' }}"
60+
+alias: comment
5261
+column_types:
5362
id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
5463
created: timestamp

integration_tests/seeds/comment.csv

Lines changed: 128 additions & 1 deletion
Large diffs are not rendered by default.

integration_tests/seeds/comment_redshift.csv

Lines changed: 6 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)