Interesting. I would expect to see a resulting plan that has a
ConstantValueExpression in a projection. That sounds like what you're
describing.
It is unfortunate that the constant ends up associated with a
non-existent temp table. That happen via this parseDisplayColumns
code?
{
// XXX hacky, assume all non-column refs come from a temp table
col.tableName = "VOLT_TEMP_TABLE";
col.columnName = "";
}
Perhaps someday we will replace .tableName and .columnName references
with accessors on expressions. I think that would be more correct and
more flexible. But a really sprawling change...
Beyond the planner, I wouldn't be surprised if the execution engine
needs a little work to support mapping projection expressions that
don't contain either a tuplevalueexpression or
parametervalueexpression in them. Or maybe that just works...
Watching the progress you're are making on these issues is a lot fun.
I hope you're enjoying Volt.
Thanks,
Ryan.
> Mike,
>
> Interesting. I would expect to see a resulting plan that has a
> ConstantValueExpression in a projection. That sounds like what you're
> describing.
Yes, you are absolutely correct. parseExpressionTree builds
ConstantValueExpression for the 'value' node.
>
> It is unfortunate that the constant ends up associated with a
> non-existent temp table. That happen via this parseDisplayColumns
> code?
>
> {
> // XXX hacky, assume all non-column refs come from a temp table
> col.tableName = "VOLT_TEMP_TABLE";
> col.columnName = "";
> }
>
Yes again.
> Perhaps someday we will replace .tableName and .columnName references
> with accessors on expressions. I think that would be more correct and
> more flexible. But a really sprawling change...
>
> Beyond the planner, I wouldn't be surprised if the execution engine
> needs a little work to support mapping projection expressions that
> don't contain either a tuplevalueexpression or
> parametervalueexpression in them. Or maybe that just works...
It actually almost does. I built a small client to compile and execute a
simple select
select 1, 'literal' from some_table;
and it worked :)
But as I already mentioned, there is still a problem if aggreagte
function(s) involved. The modified select fails to compile
select count(*), 1 from some_table;
on the ground that AggreagtePlanNode excpects all expressions to be of
TupleValueExpression type. Is it a must? Can a Constant expresion be simply
skipped during the AggreagtePlanNode::resolveColumnIndexes call? It may
still cause problem(s) down the road...
>
> Watching the progress you're are making on these issues is a lot fun.
> I hope you're enjoying Volt.
Oh yes, I enjoy it big time! Prior to joing Volt I was involved in another
in-memory database - Blackray. It's very intetesting to see a totally
different approach to the same problem. It supported much smaller subset of
SQL capabilities (no views, constraints, limited joins, etc.) but any DDL,
DML were parsed and executed dynamically.
Thanks,
Mike
>
> Thanks,
> Ryan.
on the ground that AggreagtePlanNode excpects all expressions to be of
TupleValueExpression type. Is it a must? Can a Constant expresion be simply
skipped during the AggreagtePlanNode::resolveColumnIndexes call? It may
still cause problem(s) down the road...
Blackray
on the ground that AggreagtePlanNode excpects all expressions to be of
TupleValueExpression type. Is it a must? Can a Constant expresion be simply
skipped during the AggreagtePlanNode::resolveColumnIndexes call? It may
still cause problem(s) down the road...I can't think of any reason that Aggregate would require a TVE.
BlackrayDid Blackray spin out of Deutsche Telekom? I think I met a couple of their engineers at a conference awhile ago. They were really friendly - we had a nice chat.
Re: testing / trying some different literal/constant selections, you might look at one of the regressionsuites - for example: ./tests/frontend/org/voltdb/regressionsuites/TestSQLFeaturesSuite.javaAll of the regressionsuites tests are blackbox integration style tests that spin up a voltdb database using one OS process per node. They make it easy, in particular, to test or try specific SQL statements with a lot less overhead than writing a client, project file, deployment file, etc.You can add "statement procedures" programmatically without having to define a java stored procedure. Or submit AdHoc SQL. (A statement procedure is just a single sql statement that auto-commits w/o any Java.)
Ryan.
on the ground that AggreagtePlanNode excpects all expressions to be of
TupleValueExpression type. Is it a must? Can a Constant expresion be simply
skipped during the AggreagtePlanNode::resolveColumnIndexes call? It may
still cause problem(s) down the road...I can't think of any reason that Aggregate would require a TVE.