CAMEL-24200: camel-aws2-timestream - createScheduledQuery sets the time column correctly#24909
Conversation
…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>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
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:
tableName(timeColumn)→timeColumn(timeColumn)— correct builder method ✅- Removed duplicate
scheduledQueryExecutionRoleArnblock (confirmed: lines 178 and 205 onmainare 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", timeColumn → null).
No concerns.
Claude Code on behalf of gnodet — AI-generated review
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all testedMaveniverse Scalpel detected 38 affected modules (current approach: 9).
|
Description
Fixes CAMEL-24200. In
Timestream2QueryProducer.createScheduledQuerythe time-column header was written into the target configuration's table name:So the
timeColumn(required on a scheduled-query target) was never set, and whenCamelAwsTimestreamTableNamewas 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
scheduledQueryExecutionRoleArntwice from the same header.Tests
Extends the existing
Timestream2QueryProducerTest.timestreamCreateScheduledQueryTest(which already sent all three headers but only asserted the response ARN) to capture theCreateScheduledQueryRequestvia the client mock and assertdatabaseName,tableNameandtimeColumneach come from their own header. Against the old code the table name would be"time"and the time columnnull, so the test fails without the fix.Backport
Same code on
camel-4.18.xandcamel-4.14.x; will be backported after merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).Claude Code on behalf of oscerd