Repository navigation
Expand file tree
/
Copy pathPythonEvaluator-transform.json
More file actions
75 lines (74 loc) · 2.51 KB
/
Copy pathPythonEvaluator-transform.json
File metadata and controls
75 lines (74 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
"metadata": {
"spec-version": "1.6"
},
"display-name" : "Python",
"configuration-groups": [
{
"label": "Python",
"properties": [
{
"widget-type": "python-editor",
"label": "Script",
"name": "script",
"widget-attributes": {
"default": "def transform(record, emitter, context):\n \"\"\"Transforms the provided input record into zero or more output records (as dictionaries) or errors (as an error dictionary).\n\n Input records are available as a dictionary.\n\n Args:\n record (dict): The input record as a dictionary. e.g. to access a field called 'total' from the input record, use record['total'].\n emitter (Emitter): an object that can be used to emit zero or more records (using the emitter.emit() method) or errors (using the emitter.emitError() method).\n context (Context): an object that provides access to:\n 1. CDAP Metrics - context.getMetrics().count('output', 1);\n 2. CDAP Logs - context.getLogger().debug('Received a record');\n 3. Lookups - context.getLookup('blacklist').lookup(input.id); or\n 4. Runtime Arguments - context.getArguments.get('priceThreshold')\n\n \"\"\"\n\n emitter.emit(record)\n"
}
},
{
"widget-type": "select",
"label": "Execution Mode",
"name": "executionMode",
"widget-attributes": {
"values": [
"Interpreted",
"Native"
],
"default": "Interpreted"
}
}
]
},
{
"label": "Native Mode Settings",
"properties": [
{
"widget-type": "textbox",
"label": "Python Binary",
"name": "pythonBinary",
"widget-attributes": {
"default": "python"
}
},
{
"widget-type": "textbox",
"label": "PYTHONPATH",
"name": "pythonPath"
}
]
}
],
"emit-alerts": true,
"emit-errors": true,
"outputs": [
{
"name": "schema",
"label": "schema",
"widget-type": "schema",
"widget-attributes": {
"schema-types": [
"boolean",
"int",
"long",
"float",
"double",
"bytes",
"string",
"map<string, string>"
],
"schema-default-type": "string",
"property-watch": "format"
}
}
]
}