@@ -267,19 +267,13 @@ protected boolean doCheckExistingTable(NosqlEntityInformation<?, ?> entityInform
267267 String tableNonShards = "{" + tableNonShardMap .entrySet ()
268268 .stream ().map (e -> e .getKey () + " " + e .getValue ()).
269269 collect (Collectors .joining ("," )) + "}" ;
270- String tableOthers = "{" + tableOthersMap .entrySet ().stream ()
271- .map (e -> e .getKey () + " " + e .getValue ()).
272- collect (Collectors .joining ("," )) + "}" ;
273270
274271 String entityShards = "{" + entityShardMap .entrySet ().stream ()
275272 .map (e -> e .getKey () + " " + e .getValue ()).
276273 collect (Collectors .joining ("," )) + "}" ;
277274 String entityNonShards = "{" + entityNonShardMap .entrySet ()
278275 .stream ().map (e -> e .getKey () + " " + e .getValue ()).
279276 collect (Collectors .joining ("," )) + "}" ;
280- String entityOthers = "{" + entityOthersMap .entrySet ().stream ()
281- .map (e -> e .getKey () + " " + e .getValue ()).
282- collect (Collectors .joining ("," )) + "}" ;
283277
284278 String msg ;
285279 // check shard keys and types match
@@ -297,11 +291,15 @@ protected boolean doCheckExistingTable(NosqlEntityInformation<?, ?> entityInform
297291 errors .add (msg );
298292 }
299293
300- // check non-primary keys and types match
301- if (!tableOthers .equals (entityOthers )) {
302- msg = String .format ("Non-primary key columns mismatch:" +
303- "table=%s, entity=%s." , tableOthers ,
304- entityOthers );
294+ // check kv_json_ column exist and it's type is JSON
295+ if (!tableOthersMap .containsKey (JSON_COLUMN .toLowerCase ())) {
296+ msg = String .format ("'%s' column does not exist in the table" ,
297+ JSON_COLUMN );
298+ errors .add (msg );
299+ } else if (!tableOthersMap .get (JSON_COLUMN .toLowerCase ()).
300+ equalsIgnoreCase ("json" )) {
301+ msg = String .format ("'%s' column type is not JSON in the " +
302+ "table" , JSON_COLUMN );
305303 errors .add (msg );
306304 }
307305
@@ -342,7 +340,7 @@ protected boolean doCheckExistingTable(NosqlEntityInformation<?, ?> entityInform
342340 if (LOG .isDebugEnabled ()) {
343341 LOG .debug ("JSON Schema of the table is " + jsonSchema );
344342 }
345- throw new IllegalStateException (msg , ex );
343+ LOG . warn (msg );
346344 }
347345
348346 if (!errors .isEmpty ()) {
0 commit comments