vesoft-inc / nebula-flink-connector

Flink Connector for Nebula Graph
48 stars 30 forks source link

deserialize bug for nebula NULL data #73

Closed Nicole00 closed 2 years ago

Nicole00 commented 2 years ago

The NebulaDeserializationConverter convert nebula's data to Flink data type, but we should judge if nebula data value is NULL for all Flink data type.

For example: the flink data type is BIGINT, and the code just convert nebula data value to Long, when nebula data value is NULL, then it trigger exception below:

Caused by: com.vesoft.nebula.client.graph.exception.InvalidValueException: Cannot get field long because value's type is NULL
    at com.vesoft.nebula.client.graph.data.ValueWrapper.asLong(ValueWrapper.java:332)
    at org.apache.flink.connector.nebula.table.NebulaRowDataConverter.convert(NebulaRowDataConverter.java:69)
    at org.apache.flink.connector.nebula.table.NebulaRowDataConverter.convert(NebulaRowDataConverter.java:39)
    at org.apache.flink.connector.nebula.source.NebulaInputFormat.nextRecord(NebulaInputFormat.java:164)
    at org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction.run(InputFormatSourceFunction.java:90)
    at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:110)
    at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:67)
    at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:323)

image

Nicole00 commented 2 years ago

see https://github.com/vesoft-inc/nebula-flink-connector/actions/runs/3133364870/jobs/5086652616

Nicole00 commented 2 years ago

@liuxiaocs7