First, you need to understand that the purpose of SqlSimpleParser is to fix partial or badly-formed SQL. For example, if someone has written
SELECT 1 AS y, x + FROM t WHERE c = in an editor then and wants to know completions after 'c = ', first you need to remove the malformed expression 'x +'. So, the purgeXxx methods are trying to remove bad pieces of the SQL. After they have been removed you should be able to run the results through a real SQL parser. On Tue, Nov 5, 2019 at 7:59 PM 曲修成 <[email protected]> wrote: > > Hi All: > When I use the org.apache.calcite.sql.advise.SqlSimpleParser.Query#simplify > ,have a problem: > > input sql: > select id,name from emp > > but,output sql > select * from emp > > Because org.apache.calcite.sql.advise.SqlSimpleParser.Query#purgeSelect,purge > Select > > There are many methods like purgeXXX > > Why?
