Skip to content

Commit

Permalink
METAMODEL-92: Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspersorensen committed Nov 10, 2014
1 parent 974fe2e commit a2f9711
Show file tree
Hide file tree
Showing 13 changed files with 573 additions and 340 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* [METAMODEL-18] - New module 'cassandra' for connecting and modelling Apache Cassandra databases through MetaModel.
* [METAMODEL-74] - Fixed bug related to skipping blank values when applying an aggregate function (SUM, AVG etc.)
* [METAMODEL-76] - Query parser improved to handle filters without spaces inbetween operator and operands.
* [METAMODEL-92] - For JSON, MongoDB and CouchDB: Made it possible to specify column names referring nested fields such as "name.first" or "addresses[0].city".

### Apache MetaModel 4.2.0-incubating

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.metamodel.data.DefaultRow;
import org.apache.metamodel.data.Document;
import org.apache.metamodel.data.Row;
import org.apache.metamodel.util.CollectionUtils;

/**
* Converter that assumes that keys in the documents are represented as columns
Expand All @@ -44,7 +45,8 @@ public Row convert(Document document, DataSetHeader header) {

protected Object get(Document document, String columnName) {
final Map<String, ?> map = document.getValues();
return map.get(columnName);
final Object value = CollectionUtils.find(map, columnName);
return value;
}

}
Loading

0 comments on commit a2f9711

Please sign in to comment.