rohangarg commented on PR #13553:
URL: https://github.com/apache/druid/pull/13553#issuecomment-1346167353

   @paul-rogers @imply-cheddar : This proposes an alternate way to extend the 
`FROM` grammar in Calcite. The new changes merged recently for extended table 
functions use a script `edit-parser` to update the parser file and added the 
new production rules in it. While technically currently that is the only way to 
extend `FROM` grammar in calcite for now, the script method is a bit difficult 
to use for the following reasons : 
   1. Doing more complex operations/edits on the grammar is a bit tricky in the 
script
   2. Getting a whole view of the extended grammar from code is a bit hard 
since the script generates the new parser dynamically
   3. Since the update is dynamic, every update requires a search and replace 
which makes the update a bit fragile and susceptible to logical problems when 
the underlying grammar updates
   
   An alternative approach tried in this change is to pull the relevant 
production rules from the calcite grammar and have them as template files which 
can be edited as per druid's usecases. This provides full control over the 
pulled production rule, a simple full view of the augmented grammar and also 
lesser search-replace operations (one in the current case in the pom file). 
   
   Please let me know your thoughts on it! 


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