hutiefang76 opened a new issue, #12517:
URL: https://github.com/apache/seatunnel/issues/12517

   ### Search before asking
   
   - [x] Searched existing issues and PRs. #12501 covers DuckDB identifier 
quoting; this is the separate downstream shared parameter-binding failure.
   
   ### What happened
   
   On current dev `b2045b14c`, generated JDBC Sink SQL can quote a column 
correctly and still fail in `FieldNamedPreparedStatement.prepareStatement`:
   
   ```sql
   CREATE TABLE target ("field?question" INTEGER);
   INSERT INTO target ("field?question") VALUES (:field?question);
   ```
   
   The implementation uses `sql.contains("?")` to select positional binding, so 
it sends the named SQL unchanged to the driver. Fields containing spaces, 
colons or double quotes are instead truncated by the parameter-name regex. 
Repeated/reordered parameters also fail when a name contains `?`.
   
   ### Expected behavior
   
   Generated placeholders should resolve against complete upstream field names, 
preserving repeated bindings and unused/reordered source fields. Literal or 
quoted-identifier text must not select positional binding. Configured 
positional `query` SQL should retain its existing SQL and field-order binding, 
including dialect-specific literal escaping.
   
   ### Reproduction
   
   Using the project's DuckDB JDBC 1.3.1.0, the existing test class extended 
with actual prepare/bind/execute cases produces 7 errors in 12 tests before the 
fix: four field-name cases, repeated/reordered binding, quoted-text 
interference, and a named parameter followed by `::INTEGER`. The positional and 
unknown-name controls pass. The generated Source → Sink factory flow with 
space/colon/question-mark fields also exercises the affected path.
   
   ### Version
   
   Current dev only; this report does not establish a released-version range or 
backport request. Correct target-dialect identifier quoting is still necessary; 
#12501 remains separate. This is not a DuckLake upsert, XA, or exactly-once 
request.
   


-- 
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]

Reply via email to