Skip to content

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Mar 13, 2025

Summary

This PR allows to set the timestamp column to empty to not insert the timestamp column.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16621
based on #16624
superseeds #16623

@telegraf-tiger telegraf-tiger bot added area/sql fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Mar 13, 2025
@srebhan srebhan self-assigned this Mar 13, 2025
@srebhan srebhan assigned skartikey and mstrandboge and unassigned srebhan Mar 18, 2025
Copy link
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I have a couple of small suggestions.

@skartikey skartikey removed their assignment Mar 19, 2025
@skartikey skartikey added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 19, 2025
@srebhan srebhan assigned skartikey and unassigned mstrandboge Mar 20, 2025
@srebhan
Copy link
Member Author

srebhan commented Mar 20, 2025

Maybe I'm missing something but if starting the container fails, how can it be in running state?

@skartikey
Copy link
Contributor

Maybe I'm missing something but if starting the container fails, how can it be in running state?

You're absolutely right, if starting the container fails, it won't be in a running state, so the existing code handles that correctly.

The key improvement here is about using t.Cleanup() rather than defer. When t.FailNow() is called (or any of its variants like t.Fatal()), it immediately stops test execution, and deferred functions won't run. This could leave containers running if a test fails early.

t.Cleanup() is specifically designed for this scenario - it's guaranteed to execute even if the test fails, skips, or terminates unexpectedly. This ensures proper resource cleanup in all scenarios.

@srebhan
Copy link
Member Author

srebhan commented Mar 21, 2025

@skartikey agree with t.Cleanup is a much better alternative. However, we try to avoid t.FailNow and all of the tests make heavy use of deferred functions so cleaning up only this one won't do much good. So can we postpone this and do the change in a different PR?

@telegraf-tiger
Copy link
Contributor

@mstrandboge mstrandboge merged commit 3160f73 into influxdata:master Mar 21, 2025
27 checks passed
@github-actions github-actions bot added this to the v1.34.1 milestone Mar 21, 2025
justinwwhuang pushed a commit to justinwwhuang/telegraf_fork that referenced this pull request Mar 24, 2025
justinwwhuang added a commit to justinwwhuang/telegraf_fork that referenced this pull request Mar 24, 2025
author wenweihuang <hww_justin@163.com> 1740536737 +0800
committer wenweihuang <hww_justin@163.com> 1742792171 +0800

parent 39c9a43
author wenweihuang <hww_justin@163.com> 1740536737 +0800
committer wenweihuang <hww_justin@163.com> 1742791949 +0800

Reword comments and add error descriptions

chore(deps): Bump github.com/PaesslerAG/gval from 1.2.2 to 1.2.4 (influxdata#16612)

docs(aggregators): Document default settings for period, delay and grace (influxdata#16540)

chore(licenses): Fix link and whitelist package (influxdata#16622)

fix(outputs.influxdb_v2): Use dynamic token secret (influxdata#16628)

feat(inputs.unbound): Collect histogram statistics (influxdata#16452)

Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <srebhan@influxdata.com>

chore: Run make docs

chore(deps): Bump github.com/aws/smithy-go from 1.22.2 to 1.22.3 (influxdata#16650)

chore(deps): Bump github.com/leodido/go-syslog/v4 from 4.1.0 to 4.2.0 (influxdata#16651)

chore(deps): Bump tj-actions/changed-files from v45 to v46.0.1 (influxdata#16659)

feat(outputs.stackdriver): Ensure quota is charged to configured project (influxdata#16583)

Co-authored-by: root <root@lpce28af8.homedepot.com>

chore(inputs.fritzbox): Fix linter issues (influxdata#16664)

fix(inputs.tail): Use correct initial_read_offset persistent offset naming in the code (influxdata#16643)

chore(deps): Bump golang.org/x/crypto from 0.35.0 to 0.36.0 (influxdata#16640)

fix(agent): Condense plugin source information table when multiple plugins in same file (influxdata#16638)

fix(outputs.sql): Allow to disable timestamp column (influxdata#16625)

test: Update fedora image for nightly test (influxdata#16675)

chore(deps): Bump k8s.io/api from 0.32.1 to 0.32.3 (influxdata#16653)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): Bump github.com/hashicorp/consul/api from 1.29.2 to 1.31.2 (influxdata#16652)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

feat(outputs.inlong) go mod tidy
justinwwhuang added a commit to justinwwhuang/telegraf_fork that referenced this pull request Mar 24, 2025
author wenweihuang <hww_justin@163.com> 1740536737 +0800
committer wenweihuang <hww_justin@163.com> 1742792171 +0800

parent 39c9a43
author wenweihuang <hww_justin@163.com> 1740536737 +0800
committer wenweihuang <hww_justin@163.com> 1742791949 +0800

Reword comments and add error descriptions

chore(deps): Bump github.com/PaesslerAG/gval from 1.2.2 to 1.2.4 (influxdata#16612)

docs(aggregators): Document default settings for period, delay and grace (influxdata#16540)

chore(licenses): Fix link and whitelist package (influxdata#16622)

fix(outputs.influxdb_v2): Use dynamic token secret (influxdata#16628)

feat(inputs.unbound): Collect histogram statistics (influxdata#16452)

Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <srebhan@influxdata.com>

chore: Run make docs

chore(deps): Bump github.com/aws/smithy-go from 1.22.2 to 1.22.3 (influxdata#16650)

chore(deps): Bump github.com/leodido/go-syslog/v4 from 4.1.0 to 4.2.0 (influxdata#16651)

chore(deps): Bump tj-actions/changed-files from v45 to v46.0.1 (influxdata#16659)

feat(outputs.stackdriver): Ensure quota is charged to configured project (influxdata#16583)

Co-authored-by: root <root@lpce28af8.homedepot.com>

chore(inputs.fritzbox): Fix linter issues (influxdata#16664)

fix(inputs.tail): Use correct initial_read_offset persistent offset naming in the code (influxdata#16643)

chore(deps): Bump golang.org/x/crypto from 0.35.0 to 0.36.0 (influxdata#16640)

fix(agent): Condense plugin source information table when multiple plugins in same file (influxdata#16638)

fix(outputs.sql): Allow to disable timestamp column (influxdata#16625)

test: Update fedora image for nightly test (influxdata#16675)

chore(deps): Bump k8s.io/api from 0.32.1 to 0.32.3 (influxdata#16653)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): Bump github.com/hashicorp/consul/api from 1.29.2 to 1.31.2 (influxdata#16652)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

feat(outputs.inlong) go mod tidy
srebhan added a commit that referenced this pull request Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

outputs.sql: setting timestamp_column to "" does not disable the timestamp_column
3 participants