Inherited from Dynamic
Inherited from LoggingTrait
Inherited from Externalizable
Inherited from Serializable
Inherited from Document
Inherited from Iterable[(String, Value)]
Inherited from IterableLike[(String, Value), Iterable[(String, Value)]]
Inherited from Equals
Inherited from GenIterable[(String, Value)]
Inherited from GenIterableLike[(String, Value), Iterable[(String, Value)]]
Inherited from Traversable[(String, Value)]
Inherited from GenTraversable[(String, Value)]
Inherited from GenericTraversableTemplate[(String, Value), Iterable]
Inherited from TraversableLike[(String, Value), Iterable[(String, Value)]]
Inherited from GenTraversableLike[(String, Value), Iterable[(String, Value)]]
Inherited from Parallelizable[(String, Value), ParIterable[(String, Value)]]
Inherited from TraversableOnce[(String, Value)]
Inherited from GenTraversableOnce[(String, Value)]
Inherited from FilterMonadic[(String, Value), Iterable[(String, Value)]]
Inherited from HasNewBuilder[(String, Value), Iterable[(String, org.ojai.Value)] @scala.annotation.unchecked.uncheckedVariance]
Inherited from AnyRef
Inherited from Any
OJAIDocument represents a JSON document which can be accessed with dynamic object model as well as through setters and getters. OJAIDocument extends the original org.ojai.Document with input and output types mapped to that of scala types. To create an OJAIDocument use the factory function newDocument in MapRDBSpark or through sparkContext functions loadMapRDBTable.
val doc = MapRDBSpark.newDocument(jsonString) or val docs = sc.loadMapRDBTable(tableName) Here are the ways to access elements in OJAIDocument doc.address -- accesses the element with address as the key and returns the value specified for it as AnyRef doc.address[String] -- access the elements with address as the key and returns the value specified for it as String doc.getString("address") -- getString is an accessor method that can also be used to get the value for address as String. Here are the ways to set value to a key in OJAIDocument doc.city = "San Francisco" or doc.set("city", "San Francisco")