Sergey Nuyanzin created FLINK-24638:
---------------------------------------

             Summary: Unknown variable or type 
"org.apache.flink.table.utils.DateTimeUtils"
                 Key: FLINK-24638
                 URL: https://issues.apache.org/jira/browse/FLINK-24638
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API
            Reporter: Sergey Nuyanzin


The problem is not constantly reproduced

however it is reproduced almost every 2-nd query via FlinkSqlClient containing 
{{current_timestamp}}, {{current_date}}
e.g.
{code:sql}
select extract(millennium from current_date);
select extract(millennium from current_timestamp);
select floor(current_timestamp to day);
select ceil(current_timestamp to day);
{code}

trace 
{noformat}
[ERROR] Could not execute SQL statement. Reason:
org.codehaus.commons.compiler.CompileException: Line 59, Column 16: Unknown 
variable or type "org.apache.flink.table.utils.DateTimeUtils"
        at 
org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12211)
        at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:6860)
        at org.codehaus.janino.UnitCompiler.access$13600(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$22.visitPackage(UnitCompiler.java:6472)
        at 
org.codehaus.janino.UnitCompiler$22.visitPackage(UnitCompiler.java:6469)
        at org.codehaus.janino.Java$Package.accept(Java.java:4248)
        at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6469)
        at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:6855)
        at org.codehaus.janino.UnitCompiler.access$14200(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$22$2$1.visitAmbiguousName(UnitCompiler.java:6497)
        at 
org.codehaus.janino.UnitCompiler$22$2$1.visitAmbiguousName(UnitCompiler.java:6494)
        at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:4224)
        at 
org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6494)
        at 
org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6490)
        at org.codehaus.janino.Java$Lvalue.accept(Java.java:4148)
        at 
org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6490)
        at 
org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6469)
        at org.codehaus.janino.Java$Rvalue.accept(Java.java:4116)
        at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6469)
        at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9026)
        at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:7106)
        at org.codehaus.janino.UnitCompiler.access$15800(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$22$2.visitMethodInvocation(UnitCompiler.java:6517)
        at 
org.codehaus.janino.UnitCompiler$22$2.visitMethodInvocation(UnitCompiler.java:6490)
        at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5073)
        at 
org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6490)
        at 
org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6469)
        at org.codehaus.janino.Java$Rvalue.accept(Java.java:4116)
        at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6469)
        at 
org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:9237)
        at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9123)
        at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9025)
        at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5062)
        at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4423)
        at 
org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4396)
        at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5073)
        at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4396)
        at 
org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5662)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3792)
        at org.codehaus.janino.UnitCompiler.access$6100(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$13.visitAssignment(UnitCompiler.java:3754)
        at 
org.codehaus.janino.UnitCompiler$13.visitAssignment(UnitCompiler.java:3734)
        at org.codehaus.janino.Java$Assignment.accept(Java.java:4477)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3734)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2360)
        at org.codehaus.janino.UnitCompiler.access$1800(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1494)
        at 
org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1487)
        at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:2874)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1487)
        at 
org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1567)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1553)
        at org.codehaus.janino.UnitCompiler.access$1700(UnitCompiler.java:215)
        at org.codehaus.janino.UnitCompiler$6.visitBlock(UnitCompiler.java:1493)
        at org.codehaus.janino.UnitCompiler$6.visitBlock(UnitCompiler.java:1487)
        at org.codehaus.janino.Java$Block.accept(Java.java:2779)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1487)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2476)
        at org.codehaus.janino.UnitCompiler.access$1900(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$6.visitIfStatement(UnitCompiler.java:1495)
        at 
org.codehaus.janino.UnitCompiler$6.visitIfStatement(UnitCompiler.java:1487)
        at org.codehaus.janino.Java$IfStatement.accept(Java.java:2950)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1487)
        at 
org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1567)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3388)
        at 
org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1357)
        at 
org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1330)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:822)
        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:432)
        at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:215)
        at 
org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:411)
        at 
org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:406)
        at 
org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1414)
        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:406)
        at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:378)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:237)
        at 
org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:465)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:216)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:207)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:75)
        at 
org.apache.flink.table.runtime.generated.CompileUtils.doCompile(CompileUtils.java:86)
        at 
org.apache.flink.table.runtime.generated.CompileUtils.lambda$compile$1(CompileUtils.java:74)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4864)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at 
org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4859)
        at 
org.apache.flink.table.runtime.generated.CompileUtils.compile(CompileUtils.java:74)
        at 
org.apache.flink.table.runtime.generated.GeneratedClass.compile(GeneratedClass.java:102)
        at 
org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(GeneratedClass.java:83)
        at 
org.apache.flink.table.runtime.operators.CodeGenOperatorFactory.createStreamOperator(CodeGenOperatorFactory.java:40)
        at 
org.apache.flink.streaming.api.operators.StreamOperatorFactoryUtil.createOperator(StreamOperatorFactoryUtil.java:81)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperator(OperatorChain.java:712)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:686)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:626)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.<init>(OperatorChain.java:187)
        at 
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.<init>(RegularOperatorChain.java:63)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:667)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:653)
        at 
org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:960)
        at 
org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:929)
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:753)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:574)
        at java.base/java.lang.Thread.run(Thread.java:834)

{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to