Skip to content

CAMEL-24200: camel-aws2-timestream - createScheduledQuery sets the time column correctly#24909

Merged
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24200
Jul 20, 2026
Merged

CAMEL-24200: camel-aws2-timestream - createScheduledQuery sets the time column correctly#24909
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24200

Conversation

@oscerd

@oscerd oscerd commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes CAMEL-24200. In Timestream2QueryProducer.createScheduledQuery the time-column header was written into the target configuration's table name:

if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(Timestream2Constants.TIME_COLUMN))) {
    String timeColumn = exchange.getIn().getHeader(Timestream2Constants.TIME_COLUMN, String.class);
    timestreamConfigBuilder.tableName(timeColumn);   // should be .timeColumn(...)
}

So the timeColumn (required on a scheduled-query target) was never set, and when CamelAwsTimestreamTableName was also supplied the time-column value silently overwrote the table name — creating the scheduled query against the wrong table, or having AWS reject it.

Also removes a duplicated block that set scheduledQueryExecutionRoleArn twice from the same header.

Tests

Extends the existing Timestream2QueryProducerTest.timestreamCreateScheduledQueryTest (which already sent all three headers but only asserted the response ARN) to capture the CreateScheduledQueryRequest via the client mock and assert databaseName, tableName and timeColumn each come from their own header. Against the old code the table name would be "time" and the time column null, so the test fails without the fix.

Backport

Same code on camel-4.18.x and camel-4.14.x; will be backported after merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).


Claude Code on behalf of oscerd

…me column correctly

createScheduledQuery wrote the CamelAwsTimestreamTimeColumn header into the
target TimestreamConfiguration's tableName instead of its timeColumn, so the
required time column was never set and, when a table-name header was also
supplied, the time-column value silently overwrote the table name.

Also removes a duplicated block that set scheduledQueryExecutionRoleArn twice
from the same header.

Extends Timestream2QueryProducerTest to capture the CreateScheduledQuery
request and assert the database name, table name and time column are all set
from their own headers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the bug Something isn't working label Jul 19, 2026
@oscerd
oscerd requested review from Croway and davsclaus July 19, 2026 14:50
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM — clear, well-tested bug fix.

The bug: timestreamConfigBuilder.tableName(timeColumn) should be .timeColumn(timeColumn). This meant the time column was never set, and when both CamelAwsTimestreamTableName and CamelAwsTimestreamTimeColumn headers were supplied, the time-column value silently overwrote the table name. Straightforward copy-paste error.

The fix:

  1. tableName(timeColumn)timeColumn(timeColumn) — correct builder method ✅
  2. Removed duplicate scheduledQueryExecutionRoleArn block (confirmed: lines 178 and 205 on main are identical; the PR removes the second) ✅

The test: Capturing CreateScheduledQueryRequest in the mock client and asserting that databaseName, tableName, and timeColumn each map to their respective headers is the right pattern. The test would fail without the fix (tableName"time", timeColumnnull).

No concerns.

Claude Code on behalf of gnodet — AI-generated review

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-aws/camel-aws2-timestream

🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all tested

Maveniverse Scalpel detected 38 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 9 modules (1 direct + 8 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-aws2-timestream
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (38 modules)
  • Camel :: AWS Timestream
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@oscerd oscerd self-assigned this Jul 20, 2026
@oscerd oscerd added this to the 4.22.0 milestone Jul 20, 2026
@oscerd
oscerd merged commit 020b93e into apache:main Jul 20, 2026
5 checks passed
davsclaus pushed a commit that referenced this pull request Jul 20, 2026
…me column correctly

Backport of #24909. Time-column header now sets timeColumn instead of overwriting
tableName; removes a duplicated role-ARN block.

Closes #24948

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
davsclaus pushed a commit that referenced this pull request Jul 20, 2026
…me column correctly

Backport of #24909. Time-column header now sets timeColumn instead of overwriting
tableName; removes a duplicated role-ARN block.

Closes #24949

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components components-aws

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants