Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimestampDiff causes unparse error #1025

Open
mbroecheler opened this issue Dec 6, 2024 · 0 comments
Open

TimestampDiff causes unparse error #1025

mbroecheler opened this issue Dec 6, 2024 · 0 comments

Comments

@mbroecheler
Copy link
Contributor

Using an expression like this:

TIMESTAMPDIFF(SECOND, MIN(timestamp) OVER (ORDER BY timestamp), timestamp)

results in the following error:

java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlSyntax$7: SPECIAL
        at org.apache.calcite.util.Util.needToImplement(Util.java:1101)
        at org.apache.calcite.sql.SqlSyntax$7.unparse(SqlSyntax.java:129)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:123)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:435)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.fun.SqlCastFunction.unparse(SqlCastFunction.java:190)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:435)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlAsOperator.unparse(SqlAsOperator.java:76)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter$FrameImpl.list2(SqlPrettyWriter.java:1303)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter$FrameImpl.list(SqlPrettyWriter.java:1283)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter.list(SqlPrettyWriter.java:1080)
        at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:154)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:271)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:440)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:123)
        at org.apache.calcite.sql.SqlAsOperator.unparse(SqlAsOperator.java:76)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:166)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:271)
        at org.apache.flink.sql.parser.ddl.SqlCreateView.unparse(SqlCreateView.java:125)
        at org.apache.calcite.sql.SqlNode.toSqlString(SqlNode.java:156)
        at com.datasqrl.engine.stream.flink.sql.RelToFlinkSql.lambda$convertToString$1(RelToFlinkSql.java:22)
        at com.datasqrl.actions.FlinkSqlGenerator.run(FlinkSqlGenerator.java:76)
        at com.datasqrl.engine.stream.flink.AbstractFlinkStreamEngine.plan(AbstractFlinkStreamEngine.java:60)
        at com.datasqrl.engine.stream.flink.AbstractFlinkStreamEngine.plan(AbstractFlinkStreamEngine.java:30)
        at com.datasqrl.engine.PhysicalPlanner.plan(PhysicalPlanner.java:36)
        at com.datasqrl.compile.CompilationProcess.executeCompilation(CompilationProcess.java:67)
        at com.datasqrl.cmd.AbstractCompilerCommand.execute(AbstractCompilerCommand.java:110)
        at com.datasqrl.cmd.AbstractCompilerCommand.execute(AbstractCompilerCommand.java:69)
        at com.datasqrl.cmd.AbstractCommand.run(AbstractCommand.java:26)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at com.datasqrl.DatasqrlCMD.main(DatasqrlCMD.java:13)
java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlSyntax$7: SPECIAL
        at org.apache.calcite.util.Util.needToImplement(Util.java:1101)
        at org.apache.calcite.sql.SqlSyntax$7.unparse(SqlSyntax.java:129)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:123)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:435)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.fun.SqlCastFunction.unparse(SqlCastFunction.java:190)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:435)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlAsOperator.unparse(SqlAsOperator.java:76)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter$FrameImpl.list2(SqlPrettyWriter.java:1303)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter$FrameImpl.list(SqlPrettyWriter.java:1283)
        at org.apache.calcite.sql.pretty.SqlPrettyWriter.list(SqlPrettyWriter.java:1080)
        at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:154)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:271)
        at org.apache.calcite.sql.SqlUtil.unparseBinarySyntax(SqlUtil.java:440)
        at org.apache.calcite.sql.SqlSyntax$4.unparse(SqlSyntax.java:78)
        at org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:385)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:123)
        at org.apache.calcite.sql.SqlAsOperator.unparse(SqlAsOperator.java:76)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:126)
        at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:166)
        at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:463)
        at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:271)
        at org.apache.flink.sql.parser.ddl.SqlCreateView.unparse(SqlCreateView.java:125)
        at org.apache.calcite.sql.SqlNode.toSqlString(SqlNode.java:156)
        at com.datasqrl.engine.stream.flink.sql.RelToFlinkSql.lambda$convertToString$1(RelToFlinkSql.java:22)
        at com.datasqrl.actions.FlinkSqlGenerator.run(FlinkSqlGenerator.java:76)
        at com.datasqrl.engine.stream.flink.AbstractFlinkStreamEngine.plan(AbstractFlinkStreamEngine.java:60)
        at com.datasqrl.engine.stream.flink.AbstractFlinkStreamEngine.plan(AbstractFlinkStreamEngine.java:30)
        at com.datasqrl.engine.PhysicalPlanner.plan(PhysicalPlanner.java:36)
        at com.datasqrl.compile.CompilationProcess.executeCompilation(CompilationProcess.java:67)
        at com.datasqrl.cmd.AbstractCompilerCommand.execute(AbstractCompilerCommand.java:110)
        at com.datasqrl.cmd.AbstractCompilerCommand.execute(AbstractCompilerCommand.java:69)
        at com.datasqrl.cmd.AbstractCommand.run(AbstractCommand.java:26)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at com.datasqrl.DatasqrlCMD.main(DatasqrlCMD.java:13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant