Hello,
I'm currently attempting to use Lingual (wip-257 and wip-259) over a
medium-sized dataset (7 GiB CSV)
Simple queries work.
slightly more complex cases also work:
INSERT INTO merged select source, fields
from (
select 'A' as source, fields from (select distinct
fields from A)
select 'B' as source, fields from (select distinct
fields from B)
select 'C' as source, fields from
(select distinct fields from C)
select 'D' as source, fields
from (select distinct fields from D)
select 'E' as source,
fields from (select distinct fields from E)
select 'F'
as source, fields from (select distinct fields from F)
) -- OK
... even if the resulting chain of reducers seems a bit slow (the
dataset is still workable with a "sort -u+awk+cat" pipeline for
the moment, to produce "merged")
GROUP BY queries appear to work
select sum(foo), bar from titi group by bar -- OK
However, windowed queries fail with the following message /
stack:
select sum(foo) over (partition by bar order by whatever), bar
from titi
java.lang.RuntimeException: cannot translate expression
COUNT($t11) OVER (PARTITION BY $t6 ORDER BY $t0 ROWS BETWEEN
CURRENT ROW AND CURRENT ROW)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translate0(RexToLixTranslator.java:283)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translate(RexToLixTranslator.java:127)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translate0(RexToLixTranslator.java:258)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translate(RexToLixTranslator.java:127)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translate(RexToLixTranslator.java:123)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translateList(RexToLixTranslator.java:366)
at
net.hydromatic.optiq.rules.java.RexImpTable.implementCall(RexImpTable.java:512)
....
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translateList(RexToLixTranslator.java:366)
at
net.hydromatic.optiq.rules.java.RexToLixTranslator.translateProjects(RexToLixTranslator.java:116)
at
cascading.lingual.optiq.CalcProjectUtil.addFunction(CalcProjectUtil.java:242)
at
cascading.lingual.optiq.CalcProjectUtil.addProgram(CalcProjectUtil.java:152)
at
cascading.lingual.optiq.CalcProjectUtil.resolveBranch(CalcProjectUtil.java:91)
at
cascading.lingual.optiq.CascadingProjectRel.visitChild(CascadingProjectRel.java:84)
at
cascading.lingual.optiq.CascadingEnumerableRel.implement(CascadingEnumerableRel.java:83)
at
net.hydromatic.optiq.rules.java.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:69)
at
net.hydromatic.optiq.prepare.OptiqPrepareImpl$OptiqPreparingStmt.implement(OptiqPrepareImpl.java:541)
at
net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:227)
at
net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:131)
at
net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:256)
at
net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:196)
at
net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:169)
at
net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
at
net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
at
cascading.lingual.jdbc.LingualStatement.execute(LingualStatement.java:167)
(the "cannot translate expression" always refer to COUNT(...) OVER
(PARTITION BY ...) no matter which summary function is actually
used).
Apparently, this is caused by the dependency to optiq-0.4.11, which
didn seem to fully support windowed queries.
I've attempted to update the dependency from lingual to
optiq-0.4.11, to optiq-core-0.4.12.
The gradle build now fails with an "IllegalArgumentException" in
just about any test case that tries to run some SQL.
here's the top of stack:
java.lang.IllegalArgumentException: no vertex CASCADING
at
net.hydromatic.optiq.util.graph.DefaultDirectedGraph.addEdge(DefaultDirectedGraph.java:57)
at
net.hydromatic.optiq.util.graph.DefaultDirectedGraph.addEdge(DefaultDirectedGraph.java:25)
at
org.eigenbase.relopt.ConventionTraitDef.registerConverterRule(ConventionTraitDef.java:94)
at
org.eigenbase.relopt.volcano.VolcanoPlanner.addRule(VolcanoPlanner.java:415)
at
cascading.lingual.optiq.CascadingTableAccessRel.registerRules(CascadingTableAccessRel.java:72)
at
cascading.lingual.optiq.CascadingTableAccessRel.register(CascadingTableAccessRel.java:64)
at
org.eigenbase.relopt.AbstractRelOptPlanner.registerClass(AbstractRelOptPlanner.java:200)
I guess optiq-core 0.4.12 now requires some extra initialization to
work?
I would really love to help, at least test the integration of more
recent version of optiq within Lingual, in order to perform tests
using analytic functions.
Anyway, thanks for the hard work done so far, and whichever help is
available.
-- Cyrille