Allow non-trivial expressions in `INSERT` statements

These changes really address two issues:
- Early on in planning, the method `refineValueType` was not robust to cast expressions.
- When assigning non-trivial expressions to the partitioning column in an `INSERT` statement, ad hoc planning will mark it as single-partition.  Currently our architecture cannot handle this, so we need to mark these statements as multi-partition.
I see. Yes, the C++ works something like that. The CASE WHEN is aware of
its alternative substructure and takes over selectively invoking eval on
the correct child of its child alternative. There is never a need for an
abstract eval on the alternative expression object itself.

*Paul Martel,* Software Engineer
*VoltDB, Inc.*
*E:* pmartel@voltdb.com
www.voltdb.com <http://voltdb.com>
Follow VoltDB on Twitter <https://twitter.com/voltdb>, Facebook
<https://www.facebook.com/VoltDB?sk=wall>, and LinkedIn
<http://www.linkedin.com/company/voltdb>

On Thu, Oct 2, 2014 at 10:55 PM, cwolff-voltdb <notifications@github.com>
wrote:

> In src/frontend/org/voltdb/expressions/OperatorExpression.java:
>
> > @@ -21,6 +21,20 @@
> >  import org.voltdb.types.ExpressionType;
> >  import org.voltdb.utils.VoltTypeUtil;
> >
> > +/**
> > + * An instance of OperatorExpression is one of the following:
> > + *   - + (add)
> > + *   - - (subtract)
> > + *   - * (multiply)
> > + *   - / (divide)
> > + *   - % (modulus)
> > + *   - || (concat)
> > + *   - is null
> > + *   - not
> > + *   - cast(... as type)
> > + *   - case when
> > + *   - alternative (unsupported?)
>
> I made this assumption because of the implementation of
> OperatorAlternativeExpression's eval method
> <https://github.com/VoltDB/voltdb/blob/master/src/ee/expressions/operatorexpression.h#L146>
> on the C++ side. Maybe it gets translated into CASE WHEN early on, before
> it ever gets evaluated?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/VoltDB/voltdb/pull/1701/files#r18379716>.
>