The v1 syntax 'select t.id, t.b.* from t;' seems reasonable to me for the
first level. The alias can be ignored for the star case. This is what we
do (and consistent with Postgres behavior) for queries such as 'select r.*
as x from region r;'.
For multiple levels, would there be a requirement to expand recursively to
more levels within b ? or is that not a valid requirement ? For example:
b: {
c: { x:10,
y:20
},
d: { p: 5,
q: 15
}
}
Is b.* expected to expand only to c and d levels or further ?
I think we should also look at SQL++ specification. I did a quick glance
through their paper but haven't identified the exact behavior for this
case. BTW, Jacques your name appears in the acknowledgement :)
http://arxiv.org/pdf/1405.3631v7.pdf
Aman
On Sun, Oct 4, 2015 at 10:58 AM, Ted Dunning <[email protected]> wrote:
>
> It seems to me that
>
> select t.id, t.b.* as stuff
>
> Should be the same as
>
> Select t.id, t.b as stuff
>
> That is, it shouldn't unpack the structure at all.
>
> Sent from my iPhone
>
> > On Oct 3, 2015, at 20:18, Jacques Nadeau <[email protected]> wrote:
> >
> > The alias I was mentioning is v2 below.
> >
> > v1: select t.id, t.b.* from t; (makes sense)
> > v2: select t.id, t.b.* as newcol from t; (doesn't make any sense as what
> > does it mean to alias newcol)
>