On Tue, May 27, 2014 at 3:55 PM, Daniel Halperin
<notifications@github.com>wrote:

> In raco/datalog/model.py:
>
> > @@ -448,9 +467,27 @@ def toAttrRef(e):
> >              mappings = [(None, expression.UnnamedAttributeRef(orig_pos))
> >                          for orig_pos, col in groups + aggs]
> >              plan = raco.algebra.Apply(mappings, groupby)
> > +        elif any([p for _, p in columnAndNeedApplyList]):
> > +            # if head contains one or more expressions,
> > +            # then need to do an Apply first
> > +            plan = raco.algebra.Apply([(None, e) for e in columnlist], plan)
> > +            # since we already do Apply,
> > +            # the project just gets the position of the attributes
> > +            # TODO bmyerz: I would prefer Apply to only append expressions
>
> If it makes sense for you, I would support Project meaning "keep the
> specified columns, then ensure it's a set via Distinct". Specifically,
> under this model Project's columnlist would be a list of AttributeRefs.
>
This seems right to me.

> (I suppose this enables you to repeat a column with Project, but that
> seems okay to me.)
>

(agree)


> —
> Reply to this email directly or view it on GitHub<https://github.com/uwescience/raco/pull/209/files#r13107636>
> .
>