sandynz commented on pull request #15803:
URL: https://github.com/apache/shardingsphere/pull/15803#issuecomment-1059892886
Hi @pk-218 , I'm sorry, there's no javadoc to explain `columnMetaDataMap`
(we could improve it).
From source code, `PipelineTableMetaData` is initialized in
`PipelineTableMetaDataLoader`, related code snippet:
```
boolean primaryKey = primaryKeys.contains(columnName);
PipelineColumnMetaData columnMetaData = new
PipelineColumnMetaData(ordinalPosition, columnName, dataType, dataTypeName,
primaryKey);
columnMetaDataMap.put(columnName, columnMetaData);
```
`columnMetaDataMap`'s key is column name, and also
`PipelineColumnMetaData.name`.
In our test code `Collections.singletonMap("test_column", new
PipelineColumnMetaData(1, "test", Types.INTEGER, "INTEGER", true))`. In short,
`test_column` doesn't match `test`, that's why there's NPE.
And also, we could debug the failed test case in IDE to check every step,
verify why variable is null that cause NPE.
A variables screenshot on my local debug:
<img width="728" alt="图片"
src="https://user-images.githubusercontent.com/42492540/156909192-054254a0-9920-4427-bc0c-4e8d9c7cdaf3.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]