ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Ozerov <voze...@gridgain.com>
Subject Re: Unfriendly "SELECT *"
Date Fri, 12 Feb 2016 18:05:37 GMT
Sergi,

This problem is more about aliases, then about "SELECT *". The query

FROM Employee e

doesn't work either. And this is the problem, because as soon as JOINs
appear, aliases greatly help to reduce SQL boilerplate. And as I understand
it is hard to make this query work due to complex parsing. But we can make
the query

SELECT e.* FROM Employee e

... work with minimal efforts.

On Fri, Feb 12, 2016 at 8:42 PM, Sergi Vladykin <sergi.vladykin@gmail.com>
wrote:

> Use SqlFieldsQuery, Luke! I tried, it works! :)
>
> I was always against SELECT in SqlQuery, it was terrible design decision,
> but for "historical reasons" it is supported in SqlQuery.
>
> As for adding new parsing, the more fancier parsing we will introduce, the
> worse performance we will have.
>
> Sergi
>
> 2016-02-12 15:11 GMT+03:00 Vladimir Ozerov <vozerov@gridgain.com>:
>
> > Folks,
> >
> > I noticed that the following simple *SqlQuery* doesn't not work:
> > SELECT * FROM Employee e
> >
> > The reason is that it is incorrectly expanded to
> > SELECT *Employee*._KEY, *Employee*._VAL FROM Employee *e*
> >
> > ... while correct form should be:
> > SELECT *e*._KEY, *e*._VAL FROM Employee *e*
> >
> > I understand that this is not very easy to fix because excessive query
> > parsing will be required to find our whether table has alias or not.
> >
> > Then I tried another approach, which doesn't work either:
> > SELECT e.* FROM Employee e
> >
> > And here the failure is forced by our code intentionally: only "SELECT *"
> > is allowed.
> >
> > This looks very trivial to fix for me: just allow "SELECT
> [table/alias].*"
> > as well. Does anyone see any other problems here?
> >
> > I created the ticket: https://issues.apache.org/jira/browse/IGNITE-2641
> >
> > Vladimir.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message