You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2025/04/01 23:23:44 UTC

Re: [I] Enhancing Query Context Handling: Introducing SQL-Level SETTINGS, Raw SQL Support, System Table and Context Validation (druid)

gianm commented on issue #17769:
URL: https://github.com/apache/druid/issues/17769#issuecomment-2770895108

   I like all of these ideas. They would help greatly with usability. About the first idea,
   
   > Firstly, let's introduce a SETTINGS subclause in the SQL statement.
   
   Actually, at one point last year I did look into doing this, and I wrote a proof of concept that enabled syntax like:
   
   ```
   REPLACE INTO wikipedia2 OVERWRITE ALL
   SELECT * FROM wikipedia
   PARAMETER maxNumTasks => '8'
   ```
   
   I did the PoC for `INSERT` and `REPLACE` only, not `SELECT`, because we don't currently have a custom `SELECT` statement. Although I think we could add one similar to our custom `EXPLAIN` statement, by adding entries to `config.fmpp` and adding a `select.ftl` similar to `explain.ftl`.
   
   I didn't continue working on this PR at the time because I ran into a problem: the approach I used didn't work for all context parameters. I applied them to the context used for execution, which works for runtime properties, but doesn't work for properties that affect SQL planning (such as `useApproximateCountDistinct`). Some more work would be needed to adjust it to apply the parameters earlier in the process, so they could affect SQL planning too.
   
   Anyway, it would be great to pick this back up. My branch no longer merges cleanly against master, but I can see if I can fix that. Or if anyone's interested in looking into that, I can put up the old branch as-is.


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org