simenliuxing created FLINK-22985:
------------------------------------

             Summary: sql syntax, NullPointerException
                 Key: FLINK-22985
                 URL: https://issues.apache.org/jira/browse/FLINK-22985
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Runtime
    Affects Versions: 1.13.1
            Reporter: simenliuxing
             Fix For: 1.14.0


sql:
{code:java}
CREATE TABLE source_table
(
    id               INT,
    score            INT,
    address          STRING,
    create_time      TIME,
    create_date      DATE,
    create_timestamp TIMESTAMP
) WITH (
      'connector' = 'datagen'
      );

CREATE TABLE console_table
(
    create_time      TIME,
    create_date      DATE,
    create_timestamp TIMESTAMP
) WITH (
      'connector' = 'print'
      );

INSERT INTO console_table
SELECT CASE
           WHEN A.create_time IS NULL
               OR A.create_time = '' THEN CURRENT_TIME
           ELSE A.create_time
           END
           AS create_time,
       CASE
           WHEN A.create_date IS NULL
               OR A.create_date = '' THEN CURRENT_DATE
           ELSE A.create_date
           END
           AS create_date,
       CASE
           WHEN A.create_timestamp IS NULL
               OR A.create_timestamp = '' THEN CURRENT_TIMESTAMP
           ELSE A.create_timestamp
           END
           AS create_timestamp
FROM source_table A;
{code}
exception:
{code:java}
java.lang.RuntimeException: Could not instantiate generated class 
'StreamExecCalc$23'java.lang.RuntimeException: Could not instantiate generated 
class 'StreamExecCalc$23' at 
org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(GeneratedClass.java:66)
 at 
org.apache.flink.table.runtime.operators.CodeGenOperatorFactory.createStreamOperator(CodeGenOperatorFactory.java:40)
 at 
org.apache.flink.streaming.api.operators.StreamOperatorFactoryUtil.createOperator(StreamOperatorFactoryUtil.java:80)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperator(OperatorChain.java:652)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:626)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:566)
 at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.<init>(OperatorChain.java:181)
 at 
org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:548)
 at 
org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:647)
 at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:537)
 at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759) at 
org.apache.flink.runtime.taskmanager.Task.run(Task.java:566) at 
java.lang.Thread.run(Thread.java:748)Caused by: 
java.lang.reflect.InvocationTargetException at 
sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source) at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at 
org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(GeneratedClass.java:64)
 ... 12 moreCaused by: java.lang.NullPointerException at 
StreamExecCalc$23.<init>(Unknown Source) ... 16 more
{code}



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

Reply via email to