Skip to content

NPE in the nameMapping #859

@meng1222

Description

@meng1222

Describe the bug
I did not configure the nameMapping parameter but reported NPE.Below is my configuration:
{
"job":{
"content":[
{

    "reader":{
      "name": "mysqlreader",
      "parameter": {
        "startLocation": "",
        "increColumn": "",
        "column": [
          {
            "name": "id",
            "type": "bigint"
          },
          {
            "name": "name",
            "type": "varchar"
          },
          {
            "name": "content",
            "type": "text"
          }
        ],
        "username": "root",
        "password": "root",
        "connection": [
          {
            "jdbcUrl": [
              "jdbc:mysql://1.1.1.1:3306/mysql_te?useSSL=false"
            ],
            "table": [
              "inner_02"
            ]
          }
        ]
      }
    },
    "writer":{
      "parameter":{
        "maxRetries":3,
        "parseThreadNumber":10,
        "feNodes":[
          "111:111:111:111:8030"
        ],
        "column":[{
          "name": "id",
          "type": "bigint"
        },
          {
            "name": "name",
            "type": "varchar"
          },
          {
            "name": "content",
            "type": "varchar"
          }],
        "batchSize":10,
        "username":"root",
        "table": "outer_02",
        "database": "doris_test"
      },
      "name":"doriswriter"
    },
    "nameMapping": {}
  }
],
"setting":{
  "restore":{
    "isRestore":false,
    "isStream":true
  },
  "speed":{
    "readerChannel":1,
    "writerChannel":1,
    "bytes":-1048576,
    "channel":1
  }
}

}
}

and i get this error report:
2022-05-23 14:18:22,849 - 7533 WARN [Flat Map (1/1)#0] org.apache.flink.runtime.taskmanager.Task:Flat Map (1/1)#0 (5f50cb066576baf15642d261b279e090) switched from RUNNING to FAILED.
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at com.dtstack.chunjun.mapping.Mapping.getIdentityIndex(Mapping.java:64)
at com.dtstack.chunjun.mapping.NameMapping.map(NameMapping.java:58)
at com.dtstack.chunjun.mapping.NameMapping.map(NameMapping.java:43)
at com.dtstack.chunjun.mapping.MappingClient.map(MappingClient.java:58)
at com.dtstack.chunjun.mapping.NameMappingFlatMap.flatMap(NameMappingFlatMap.java:62)
at com.dtstack.chunjun.mapping.NameMappingFlatMap.flatMap(NameMappingFlatMap.java:41)
at org.apache.flink.streaming.api.operators.StreamFlatMap.processElement(StreamFlatMap.java:47)
at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:191)
at org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.processElement(StreamTaskNetworkInput.java:204)
at org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.emitNext(StreamTaskNetworkInput.java:174)
at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)
at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:398)
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:191)
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:619)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:583)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:758)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:573)
at java.lang.Thread.run(Thread.java:750)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions