Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18437

Camel-bigquery: There is a difference in types between @name and ${name}

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Do
    • 3.19.0
    • 3.21.0
    • camel-google-bigquery
    • None
    • Unknown

    Description

      I noticed a undefined behavior when expanding coverage of google-bigquery in camel-quarkus (ticket).

       

      Here is a relevant chapter from the documentation.]
       

      • 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

      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".
      1. If header value is an integer (like 4), sql is translated into ... VALUES (4) ..., so it is interpreted as integer.
      2. If header value is string with number inside (like "4"), sql is translated into ... VALUES (4) ..., so it is interpreted as integer.
      3. 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.

      Attachments

        Activity

          People

            jondruse Jiri Ondrusek
            jondruse Jiri Ondrusek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: