Claus Ibsen created CAMEL-26251:
-----------------------------------

             Summary: camel-google-bigquery - the component connectionFactory 
option is ignored, and a DDL query in bigquery-sql likely fails with a 
NullPointerException
                 Key: CAMEL-26251
                 URL: https://issues.apache.org/jira/browse/CAMEL-26251
             Project: Camel
          Issue Type: Bug
          Components: camel-google-bigquery
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of google-bigquery and 
google-bigquery-sql (CAMEL-24961, PR #28404).

h4. 1. The component-level connectionFactory is ignored

{{GoogleBigQueryComponent}} and {{GoogleBigQuerySQLComponent}} have a 
{{connectionFactory}} option (lines 40 and 38), but the endpoints only read 
{{configuration.getConnectionFactory()}} ({{GoogleBigQueryEndpoint.doStart}}, 
main 2a465aa4814c, line 68; {{GoogleBigQuerySQLEndpoint}}, line 69), and 
{{createEndpoint}} copies the component's {{configuration}}, not this field. 
{{component.setConnectionFactory(...)}} is silently ignored and a default 
client is built from the endpoint options. Checked on 4.24.0-SNAPSHOT with the 
goccy bigquery-emulator in docker.

Proposed: use the component's connectionFactory when the endpoint configuration 
has none.

h4. 2. bigquery-sql: a DDL query likely fails with a NullPointerException

{{GoogleBigQuerySQLProducer}} (line 100) assigns {{getNumDmlAffectedRows()}} to 
a {{long}} for every non-SELECT job; for DDL (CREATE TABLE...) the value is 
null, so the unboxing throws a NullPointerException. Read in the code, not run.

Proposed: use a {{Long}} and set the body to null (or 0) when there is no DML 
count.

h4. 3. bigquery: a bad entry of a grouped exchange is silently dropped

{{GoogleBigQueryProducer.process}} (line 141) sets the "Cannot handle body 
type" exception on the inner exchange of a grouped exchange, which nobody looks 
at, so the outer exchange completes as a success and the bad entry is dropped 
without notice. Read in the code, not run.

Proposed: set the exception on the exchange being processed (or fail the whole 
request).

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to