complone commented on issue #17619:
URL: 
https://github.com/apache/shardingsphere/issues/17619#issuecomment-1133815111

   > > 目前实现的方言转换支持内置jooq,
   > > jooq实现方言转换的原理是根据基于DSL上下文的anltr4规则和标准,将对一个数据库的请求转移到另一个数据库
   > > 如果我们现在想实现本地方言
   > > 我有个主意
   > > 
   > > 1. 基于anltr4的PostgreSQL方言https://github.com/tshprecher/antlr_psql例如这里的解析逻辑
   > > 2. 转换的逻辑参考jooq的abstractquery#getsql方法
   > > 
   > > 这样完成从Mysql到Postgres的原生SQL翻译
   > > 我想知道这是否可行?
   > 
   > 对于目前的情况,使用重写模块中的 SQL 令牌来重写 SQL 更好。 对于长期路线图,我更喜欢在重写模块中使用 SQL 令牌来重写 
SQL,但它需要改变重写模块的整个逻辑。
   
   @terrymanu I think we should provide abstract methods about ```ASTBudiler``` 
in ```AbstractSQLBudiler``` so that subclasses can rewrite the logic of AST 
traversal. I plan to refer to the grammar parsing layer of presto to construct 
and traverse [AST ](https://github.com/ 
prestodb/presto/blob/master/presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java)


-- 
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: notifications-unsubscr...@shardingsphere.apache.org

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

Reply via email to