javasqlapache-calcitesql-parser

how to traverse sqlNode in calcite


I need to convert all the table name and column name to another name in a SQL query which will be in form of string and I have to do it using the Calcite SQL parser. I only know that I have to implement the visitor interface, but I have no clue how to do it. Please help me out and give me some basic information as to how to do that.

Sorry for asking basic question like this, but I went through the documentation of Calcite sqlparser and got no idea what to do, also there are minimal tutorials on it.


Solution

  • i got this code at github which helped, it shows the basic operation on the tree such as getting tablename and columnname

    github code

    some more examples of calcite codes