H2 to some extent supports syntax (and quirks) from other databases. For
example you can start it with MODE=MySQL and it will allow some MySQL
specific syntax to be handled.

Having said that, IMO the most correct way to handle non-standard syntax is
to introduce H2 MODE=ApacheIgnite and put the needed switches there.

Though this needs to be negotiated with H2 folks.

Sergi

2017-01-27 15:15 GMT+03:00 Alexey Kuznetsov <akuznet...@apache.org>:

> We should care about statements like this:
> /* bla-bla */ CREATE TABLE
>
> So naive "startsWith(...)" will not work in some scenarios.
>
> :)
>
> On Fri, Jan 27, 2017 at 7:06 PM, Vladimir Ozerov <voze...@gridgain.com>
> wrote:
>
> > Folks,
> >
> > H2 has nice and powerful SQL parser, and we pass all incoming SQL
> commands
> > through it. However it doesn't support custom SQL syntax, which we are
> > likely to need in DDL at some point in future.
> >
> > As DDL statements are relatively easy to parse comparing to SELECTs and
> > they do not involve optimizer, we can easily create object model of DDL
> > command without invoking H2 at all.
> >
> > I propose to introduce small change into our parsing logic as follows:
> >
> > if (req.startsWith("CREATE" or "ALTER" or "DELETE")
> >     parseDdlManually(req);
> > else
> >     parseWithH2(req);
> >
> > It should be enough to support any custom syntax for our DDL with any
> > limitations and without any dependencies on H2 folks.
> >
> > For instance, see H2 "CREATE TABLE" [1] and "CREATE INDEX" [2] structure.
> > It is already very simple. But provided that Ignite doesn't support most
> of
> > H2 DDL features, Ignite DDL structure will be even simpler.
> >
> > it should take no more than 1-2 days to implement fully-fledged parsing
> for
> > these two commands.
> >
> > Thoughts?
> >
> > Vladimir.
> >
> > [1] http://www.h2database.com/html/grammar.html#create_table
> > [2] http://www.h2database.com/html/grammar.html#create_index
> >
>
>
>
> --
> Alexey Kuznetsov
>

Reply via email to