Skip to content

Commit

Permalink
Fixed issue where serde info parameters were not getting stored when …
Browse files Browse the repository at this point in the history
…creating a s3 table.
  • Loading branch information
ajoymajumdar committed Mar 24, 2016
1 parent ca81511 commit e3ecbfc
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javax.inject.Inject;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
Expand All @@ -62,7 +63,7 @@ public StorageInfo toStorageInfo(Table table){
result.setInputFormat(info.getInputFormat());
result.setOutputFormat(info.getOutputFormat());
result.setSerializationLib(info.getSerializationLib());
result.setParameters(Maps.newHashMap(info.getParameters()));
result.setSerdeInfoParameters(Maps.newHashMap(info.getParameters()));
}
}
return result;
Expand Down Expand Up @@ -90,7 +91,14 @@ public Location fromStorageInfo(StorageInfo storageInfo, String owner){
info.setInputFormat( storageInfo.getInputFormat());
info.setOutputFormat( storageInfo.getOutputFormat());
info.setSerializationLib( storageInfo.getSerializationLib());
info.setParameters( storageInfo.getParameters());
Map<String, String> parameters = Maps.newHashMap();
if( storageInfo.getParameters() != null){
parameters.putAll(storageInfo.getParameters());
}
if( storageInfo.getSerdeInfoParameters() != null){
parameters.putAll(storageInfo.getSerdeInfoParameters());
}
info.setParameters( parameters);
result.setInfo(info);
} else if ( owner != null){
Info info = new Info();
Expand Down

0 comments on commit e3ecbfc

Please sign in to comment.