slamdata/slamengine — pull request #470 by mossprescott (2014-11-26 21:20:09+00:00)
Title: re-imagined objectConcat (Fixes #458)

Now matching several additional patterns in objectConcat,
8 in all, meant to cover all the possibilites of known
shapes with a correct implementation for each combination.
Cases produced by wildcards are explicitly matched and
the existing merge-based code is used only in those cases.
If any other shape is encountered, the planner fails with
'unrecognized shapes' and we'll have to figure it out.

GroupBuilders now keep track of the source and keys they
are built from, even as expressions get folded into them.
This allows objectConcat to easily, definitively tell when two
GroupBuilders can be combined, without having to inspect keys,
which may have been rewritten. `GroupId` contains the list of
builders for the source and keys, but only the hashCode is
shown to keep the log clean.

Scalacheck tests for the planner, generating queries with
a combination of ExprOps, JS exprs, and reducing functions
in the projections, with and without a "group by" clause.
Assertions check for too many group and/or unwind ops, and
consecutive simpleMaps. This has been *very* productive in
finding problem cases, and can easily be extended to other
type of queries.

One pending scalacheck test for a problematic case (see #469).

Many tests now have nicer tmp names (fewer missing numbers),
and one or two got worse.

Random JS-generation stuff:
- `JsMacro.compose`
- Fixed indent for JS object constructors.
- Switched some `toJs` methods to JsMacro (the last, I think).
- Some `Access` nodes became prettier `Select`s.

Fixed the untyper for math functions.