davsclaus commented on PR #26916:
URL: https://github.com/apache/camel/pull/26916#issuecomment-5848951772
Correcting the evidence I filed this on.
I checked the benchmark traces properly and the `:name` mistake is **already
handled**, by CAMEL-24869: `SourceValidator.validateYamlEndpoints` detects it
at authoring time, with casts and time literals covered, and `camel_edit_file`
refuses the write. The model was told, in those words, and acted on it:
```
camel_edit_file -> {"status":"invalid","errors":["Line 29: sql: :customer is
not a camel-sql named parameter
(the JDBC driver gets it as written and fails with a syntax error): write
:#customer for a header or a key
of a Map body, or :#${body[customer]} with a Simple expression (also
:country)"]}
```
and the next model turn: *"I see - for named parameters in SQL, I need to
use `:#` prefix. Let me fix that"*.
So the claim in this issue that the parameter syntax is why all 20 attempts
of that benchmark step failed is **wrong**. Those attempts failed on the SQL
dialect — `MERGE INTO ... ON DUPLICATE KEY UPDATE` (MySQL) and `ON CONFLICT`
(Postgres) against H2, where the standard `MERGE INTO ... USING (VALUES ...)
WHEN MATCHED` form is needed. That is database knowledge, not Camel's concern.
What remains, and is why I would still keep the change: CAMEL-24869 lives in
the authoring tooling, so it helps only an author who validates. Someone
hand-writing a route and running `camel run` gets nothing today — the query
reaches the database and comes back as the database's own syntax complaint. The
warning at endpoint creation covers that path.
It is therefore a smaller, optional improvement rather than the fix I
described, and it duplicates detection that already exists at another layer
(camel-sql cannot depend on camel-jbang-core, so the logic cannot be shared).
Closing this is a reasonable call if the duplication is not worth the reach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]