File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ public Entity get(Scalar key) {
115
115
116
116
@ Override
117
117
public boolean put (Scalar key , Entity value ) {
118
- if (key .getDataType () != getKeyDataType () || (value .getDataType () != getDataType ()))
118
+ if (key .getDataType () != getKeyDataType () || (( value .getDataType () == DATA_TYPE . DT_ANY ) && ( value . getDataType () != getDataType () )))
119
119
return false ;
120
120
else {
121
121
dict .put (key , value );
@@ -198,8 +198,14 @@ public void write(ExtendedDataOutput out) throws IOException{
198
198
throw new IOException ("Can't streamlize the dictionary with value type " + valueType .name ());
199
199
200
200
BasicEntityFactory factory = new BasicEntityFactory ();
201
- Vector keys = (Vector )factory .createVectorWithDefaultValue (keyType , dict .size (), -1 );
202
- Vector values = (Vector )factory .createVectorWithDefaultValue (valueType , dict .size (), -1 );
201
+ Vector keys = factory .createVectorWithDefaultValue (keyType , dict .size (), -1 );
202
+ Vector values ;
203
+ if (valueType == DATA_TYPE .DT_ANY ) {
204
+ values = new BasicAnyVector (dict .size ());
205
+ } else {
206
+ values = factory .createVectorWithDefaultValue (valueType , dict .size (), -1 );
207
+ }
208
+
203
209
int index = 0 ;
204
210
try {
205
211
for (Map .Entry <Entity , Entity > entry : dict .entrySet ()){
You can’t perform that action at this time.
0 commit comments