calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: TUMBLE/HOP/SESSION_START/END do not resolve time field correctly
Date Tue, 25 Apr 2017 17:01:10 GMT
Can you log a bug please? I will help out if I can.

When this is fixed, I presume you will need a Calcite release at the
appropriate time so that you can release Flink. Can you start a
separate email thread when you know that timing?

On Tue, Apr 25, 2017 at 7:13 AM, Timo Walther <twalthr@apache.org> wrote:
> Hi all,
>
>
> I'm working on integrating START and END for TUMBLE/HOP/SESSION in Flink SQL
> with logical time indicator columns (e.g. rowtime, proctime). It seems there
> is a bug in the resolution logic of SqlToRelConverter. Since our feature
> freeze is next week and this feature should be part of Flink 1.3, it would
> be great if you can help me with at least a hint for a quick fix.
>
>
> The problem is as follows:
>
>
> Input: MyTable(INTEGER a, VARCHAR b, BIGINT c, TIMESTAMP proctime, TIMESTAMP
> rowtime)
>
> SQL: SELECT COUNT(*), TUMBLE_START(rowtime, INTERVAL '15' MINUTE),
> TUMBLE_END(rowtime, INTERVAL '15' MINUTE) FROM MyTable GROUP BY
> TUMBLE(rowtime, INTERVAL '15' MINUTE)
>
> Exception:
>
> java.lang.RuntimeException: while converting
> TUMBLE_START(`MyTable`.`rowtime`, INTERVAL '15' MINUTE)
>
>     at
> org.apache.calcite.sql2rel.ReflectiveConvertletTable$2.convertCall(ReflectiveConvertletTable.java:134)
>     at
> org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:61)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4415)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3783)
>     at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:137)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4317)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2723)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2541)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:654)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:616)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2951)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:552)
>     .....
> Caused by: java.lang.reflect.InvocationTargetException
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at
> org.apache.calcite.sql2rel.ReflectiveConvertletTable$2.convertCall(ReflectiveConvertletTable.java:131)
>     ... 42 more
> Caused by: java.lang.AssertionError
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.getRootField(SqlToRelConverter.java:4132)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.adjustInputRef(SqlToRelConverter.java:3446)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:3421)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter.access$1800(SqlToRelConverter.java:207)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4424)
>     at
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java
>
>
> The tests in Calcite only cover the case where rowtime is at the beginning
> of a row. Once rowtime is somewhere else, the indices are messed up. I tried
> to debug it, but I'm stuck at SqlToRelConverter#convertIdentifier().
>
>
> Any help is very welcome.
>
>
> Regards,
>
> Timo
>

Mime
View raw message