-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathPig.JSON-tmLanguage
125 lines (125 loc) · 4.61 KB
/
Pig.JSON-tmLanguage
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
"fileTypes": [
"pig",
"pig.substituted"
],
"name": "Pig",
"patterns": [
{
"begin": "/\\*",
"end": "\\*/",
"name": "comment.block.pig"
},
{
"match": "(--).*$\\n?",
"name": "comment.line.double-dash.asciidoc"
},
{
"match": "\\b(?i:ASSERT|LOAD|STORE|DUMP|FILTER|DISTINCT|FOREACH|GENERATE|STREAM|JOIN|COGROUP|GROUP|CROSS|ORDER|LIMIT|UNION|SPLIT|DESCRIBE|EXPLAIN|ILLUSTRATE|AS|BY|INTO|USING|LIMIT|PARALLEL|OUTER|INNER|DEFAULT|LEFT|SAMPLE|RANK|CUBE|ALL|KILL|QUIT|MAPREDUCE|ASC|DESC|THROUGH|SHIP|CACHE|DECLARE|CASE|WHEN|THEN|END|IN|PARTITION|FULL|IMPORT|IF|ONSCHEMA|INPUT|OUTPUT)\\b",
"name": "keyword.control.pig"
},
{
"match": "\\b(?i:int|long|float|double|chararray|bytearray|boolean|datetime|biginteger|bigdecimal|tuple|bag|map)\\b",
"name": "storage.datatypes.pig"
},
{
"match": "\\b(PigStorage|BinStorage|BinaryStorage|PigDump|HBaseStorage|JsonLoader|JsonStorage|AvroStorage|TextLoader|PigStreaming|TrevniStorage|AccumuloStorage)\\b",
"name": "support.function.storage.pig"
},
{
"match": "\\b(DIFF|TOBAG|TOMAP|TOP|TOTUPLE|RANDOM|FLATTEN|flatten|CUBE|ROLLUP|IsEmpty|ARITY|PluckTuple|SUBTRACT|BagToString)\\b",
"name": "support.function.udf.pig"
},
{
"match": "\\b(ABS|ACOS|ASIN|ATAN|CBRT|CEIL|COS|COSH|EXP|FLOOR|LOG|LOG10|ROUND|ROUND_TO|SIN|SINH|SQRT|TAN|TANH|AVG|COUNT|COUNT_STAR|MAX|MIN|SUM|COR|COV)\\b",
"name": "support.function.udf.math.pig"
},
{
"match": "\\b(CONCAT|INDEXOF|LAST_INDEX_OF|LCFIRST|LOWER|REGEX_EXTRACT|REGEX_EXTRACT_ALL|REPLACE|SIZE|STRSPLIT|SUBSTRING|TOKENIZE|TRIM|UCFIRST|UPPER|LTRIM|RTRIM|ENDSWITH|STARTSWITH|TRIM)\\b",
"name": "support.function.udf.string.pig"
},
{
"match": "\\b(AddDuration|CurrentTime|DaysBetween|GetDay|GetHour|GetMilliSecond|GetMinute|GetMonth|GetSecond|GetWeek|GetWeekYear|GetYear|HoursBetween|MilliSecondsBetween|MinutesBetween|MonthsBetween|SecondsBetween|SubtractDuration|ToDate|WeeksBetween|YearsBetween|ToMilliSeconds|ToString|ToUnixTime)\\b",
"name" : "support.function.udf.datetime.pig"
},
{
"match": "\\b(cat|cd|copyFromLocal|copyToLocal|cp|ls|mkdir|mv|pwd|rm)\\b",
"name": "support.function.command.pig"
},
{
"match": "\\$[a_zA-Z0-9_]+",
"name": "variable.pig"
},
{
"match": "(?i)\\b(NULL|true|false|stdin|stdout|stderr)\\b",
"name" : "constant.language.pig"
},
{
"match": "\\b\\d+(\\.\\d+)?\\b",
"name" : "constant.numeric.pig"
},
{
"match": "(?i)!=|==|<|>|<=|>=|(?:\\b(?:MATCHES|IS|OR|AND|NOT)\\b)",
"name": "keyword.operator.comparison.pig"
},
{
"match": "(\\+|\\-|\\*|\\/|\\%|\\?|:|::|\\.\\.|#)",
"name": "keyword.operator.arithmetic.pig"
},
{
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.pig",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.pig"
}
]
},
{
"begin": "'",
"end": "'",
"name": "string.quoted.single.pig",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.pig"
}
]
},
{
"captures": {
"1": {
"name": "storage.type.variable.pig"
}
},
"match": "(?i)^\\s*([a-z_][a-z0-9_]*)\\s*(?:=)"
},
{
"begin": "(?i)^\\s*(set)\\s+(\\S+)",
"end": "$",
"beginCaptures": {
"1" : { "name" : "keyword.parameter.pig"},
"2" : { "name" : "storage.type.parameter.pig"}
},
"patterns": [
{ "include": "$self" }
]
},
{
"captures": {
"1": {
"name": "keyword.alias.pig"
},
"2": {
"name": "storage.type.alias.pig"
}
},
"begin": "(?i)\\s*(DEFINE|DECLARE|REGISTER)\\s+(\\S+)",
"end":";?$"
}
],
"scopeName": "source.pig",
"uuid": "6B102D86-1EB7-4729-94E5-8EE7D3D6F82B"
}