Andrea Cosentino created CAMEL-24200:
----------------------------------------

             Summary: camel-aws2-timestream: createScheduledQuery writes the 
time column into tableName and never sets timeColumn
                 Key: CAMEL-24200
                 URL: https://issues.apache.org/jira/browse/CAMEL-24200
             Project: Camel
          Issue Type: Bug
          Components: camel-aws
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.14.9, 4.22.0, 4.18.4


In Timestream2QueryProducer.createScheduledQuery, the 
CamelAwsTimestreamTimeColumn header is written into the *table name* of the 
target TimestreamConfiguration:

{code:java}
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(timeColumn)
}
{code}

Consequences: the time column is never set on the TimestreamConfiguration (it 
is required for a scheduled query target), and when both 
CamelAwsTimestreamTableName and CamelAwsTimestreamTimeColumn are provided the 
time-column value silently overwrites the table name, so the scheduled query is 
created against the wrong table (or is rejected by AWS).

Secondary: the same method sets scheduledQueryExecutionRoleArn twice from the 
same header (two identical blocks); the second block is redundant.

Code reference (main): Timestream2QueryProducer.java ~lines 218-221 (time 
column) and ~175-178 / ~202-205 (duplicated role ARN).

Fix: call timestreamConfigBuilder.timeColumn(timeColumn) and drop the 
duplicated role-ARN block.

Present on camel-4.18.x and camel-4.14.x; backport to both.

Found during an agent-assisted audit of the AWS components; verified against 
the cited code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to