altmannmarcelo opened a new pull request, #2320:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2320

   Enable comment-based optimizer hint parsing for the PostgreSQL dialect by 
overriding `supports_comment_optimizer_hint` to return `true`.
   
   PostgreSQL itself does not ship a built-in hint system, but the widely used 
`pg_hint_plan` extension (https://github.com/ossc-db/pg_hint_plan) introduces 
hints using the exact same `/*+ ... */` block-comment and `--+ ...` 
single-line-comment syntax already supported for MySQL and Oracle (#2162). 
Without this flag, parsing a `pg_hint_plan` statement such as:
   
       SELECT /*+ SeqScan(t) */ * FROM t;
   
   discards the hint as an ordinary comment, making it impossible for 
downstream tools (query rewriters, proxies, planners) built on `sqlparser-rs` 
to preserve or act on hints when targeting PostgreSQL.
   
   The parser side already handles this via `maybe_parse_optimizer_hint` across 
SELECT / INSERT / UPDATE / DELETE / MERGE, so no parser or AST changes are 
required — this is purely a dialect opt-in. The default remains `false`, so no 
other dialect is affected.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to