Commit cc90994 1 parent dc77fc1 commit cc90994 Copy full SHA for cc90994
File tree 1 file changed +7
-6
lines changed
neo4jwriter/src/main/java/com/alibaba/datax/plugin/writer/neo4jwriter
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -198,13 +198,14 @@ public void tryWrite(Record record) {
198
198
199
199
private MapValue checkAndConvert (Record record ) {
200
200
int sourceColNum = record .getColumnNumber ();
201
- List <Neo4jProperty > neo4JProperties = writeConfig .neo4jProperties ;
202
-
203
- int len = Math .min (sourceColNum , neo4JProperties .size ());
204
- Map <String , Value > data = new HashMap <>(len * 4 / 3 );
205
- for (int i = 0 ; i < len ; i ++) {
201
+ List <Neo4jProperty > neo4jProperties = writeConfig .neo4jProperties ;
202
+ if (neo4jProperties == null || neo4jProperties .size () != sourceColNum ){
203
+ throw new DataXException (Neo4jErrorCode .CONFIG_INVALID ,"the read and write columns do not match!" );
204
+ }
205
+ Map <String , Value > data = new HashMap <>(sourceColNum * 4 / 3 );
206
+ for (int i = 0 ; i < sourceColNum ; i ++) {
206
207
Column column = record .getColumn (i );
207
- Neo4jProperty neo4jProperty = neo4JProperties .get (i );
208
+ Neo4jProperty neo4jProperty = neo4jProperties .get (i );
208
209
try {
209
210
210
211
Value value = ValueAdapter .column2Value (column , neo4jProperty );
You can’t perform that action at this time.
0 commit comments