You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jiri Ondrusek (Jira)" <ji...@apache.org> on 2022/08/29 12:31:00 UTC
[jira] [Created] (CAMEL-18437) Camel-bigquery: There is a difference in types between @name and ${name}
Jiri Ondrusek created CAMEL-18437:
-------------------------------------
Summary: Camel-bigquery: There is a difference in types between @name and ${name}
Key: CAMEL-18437
URL: https://issues.apache.org/jira/browse/CAMEL-18437
Project: Camel
Issue Type: Bug
Components: camel-google-bigquery
Affects Versions: 3.19.0
Reporter: Jiri Ondrusek
Assignee: Jiri Ondrusek
I noticed a undefined behavior when expanding coverage of google-bigquery in camel-quarkus ([ticket|https://github.com/apache/camel-quarkus/issues/3949]).
Here is a relevant chapter from the [documentation|#_uri_format].]
{quote} * parameters in form ${name} are extracted from message headers and formed the translated query
* parameters in form @name are extracted from body or message headers and sent to Google Bigquery{quote}
From my PoV is that in case of parameters in the header, it should not matter, whether _@name_ or _${name}_ is used.
The behavior seems to be more complicated:
* In case of _@name_ pattern, value types are dynamically resolved (see https://issues.apache.org/jira/browse/CAMEL-18382 for more details)
* In case of {_}${name}{_}, value is inserted into the sql without any modification. Which behaves like "undefined".
# If header value is an integer (like 4), sql is translated into {_}... VALUES (4) ...{_}, so it is interpreted as integer.
# If header value is string with number inside (like "4"), sql is translated into {_}... VALUES (4) ...{_}, so it is interpreted as integer.
# If the header is string (like "s4"), sql is translated into {_}... VALUES (s4) ...{_}, and the execution fails.
It would make sense that the behavior of _@name_ and _${name}_ is the same and mainly the case 3 does not cause any failure.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)