MCPcopy Create free account
hub / github.com/apache/pig / pigMapToJS

Method pigMapToJS

src/org/apache/pig/scripting/js/JsFunction.java:286–295  ·  view source on GitHub ↗

converts a map to javascript object based on a schema @param map the map to convert @param schema the schema to use for conversion @param depth call depth used for debugging messages @return the resulting javascript object

(Map<String, Object> map, Schema schema, int depth)

Source from the content-addressed store, hash-verified

284 * @return the resulting javascript object
285 */
286 private Scriptable pigMapToJS(Map<String, Object> map, Schema schema, int depth) {
287 debugConvertPigToJS(depth, "Map", map, schema);
288 Scriptable object = jsScriptEngine.jsNewObject();
289
290 for (Entry<String, Object> entry : map.entrySet()) {
291 object.put(entry.getKey(), object, entry.getValue());
292 }
293 debugReturn(depth, object);
294 return object;
295 }
296
297 /**
298 * converts a bag to javascript object based on a schema

Callers 1

pigTupleToJSMethod · 0.95

Calls 7

debugConvertPigToJSMethod · 0.95
debugReturnMethod · 0.95
jsNewObjectMethod · 0.80
entrySetMethod · 0.80
getValueMethod · 0.65
putMethod · 0.45
getKeyMethod · 0.45

Tested by

no test coverage detected