hive.syntax 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. # HQL syntax highlighting
  2. # by Michal Lorek <michal.lorek@gmail.com>
  3. caseinsensitive
  4. context default
  5. # Keywords
  6. keyword whole TRUE white
  7. keyword whole FALSE white
  8. keyword whole ALL white
  9. keyword whole NONE white
  10. keyword whole AND white
  11. keyword whole OR white
  12. keyword whole NOT white
  13. keyword whole ! brightcyan
  14. keyword whole LIKE white
  15. keyword whole ANY white
  16. keyword whole IF white
  17. keyword whole EXISTS white
  18. keyword whole ASC white
  19. keyword whole DESC white
  20. keyword whole NULLS white
  21. keyword whole LAST white
  22. keyword whole ORDER white
  23. keyword whole GROUP white
  24. keyword whole BY white
  25. keyword whole HAVING white
  26. keyword whole WHERE white
  27. keyword whole FROM white
  28. keyword whole AS white
  29. keyword whole SELECT white
  30. keyword whole DISTINCT white
  31. keyword whole INSERT white
  32. keyword whole OVERWRITE magenta
  33. keyword whole OUTER white
  34. keyword whole UNIQUEJOIN white
  35. keyword whole PRESERVE white
  36. keyword whole JOIN white
  37. keyword whole LEFT white
  38. keyword whole RIGHT white
  39. keyword whole FULL white
  40. keyword whole ON white
  41. keyword whole PARTITION white
  42. keyword whole PARTITIONS white
  43. keyword whole TABLE white
  44. keyword whole TABLES white
  45. keyword whole COLUMNS white
  46. keyword whole INDEX white
  47. keyword whole INDEXES white
  48. keyword whole REBUILD white
  49. keyword whole FUNCTIONS white
  50. keyword whole SHOW white
  51. keyword whole MSCK white
  52. keyword whole REPAIR white
  53. keyword whole DIRECTORY magenta
  54. keyword whole LOCAL magenta
  55. keyword whole TRANSFORM white
  56. keyword whole USING white
  57. keyword whole CLUSTER white
  58. keyword whole DISTRIBUTE white
  59. keyword whole SORT white
  60. keyword whole UNION white
  61. keyword whole EXCEPT white
  62. keyword whole LOAD white
  63. keyword whole EXPORT white
  64. keyword whole IMPORT white
  65. keyword whole REPLICATION white
  66. keyword whole METADATA white
  67. keyword whole DATA white
  68. keyword whole INPATH white
  69. keyword whole IS white
  70. keyword whole NULL white
  71. keyword whole CREATE white
  72. keyword whole EXTERNAL white
  73. keyword whole ALTER white
  74. keyword whole CHANGE white
  75. keyword whole COLUMN white
  76. keyword whole FIRST white
  77. keyword whole AFTER white
  78. keyword whole DESCRIBE magenta
  79. keyword whole DROP white
  80. keyword whole RENAME white
  81. keyword whole TO white
  82. keyword whole COMMENT white
  83. keyword whole BOOLEAN white
  84. keyword whole TINYINT white
  85. keyword whole SMALLINT white
  86. keyword whole INT white
  87. keyword whole INTEGER white
  88. keyword whole BIGINT white
  89. keyword whole FLOAT white
  90. keyword whole DOUBLE white
  91. keyword whole PRECISION white
  92. keyword whole DATE white
  93. keyword whole DATETIME white
  94. keyword whole TIMESTAMP white
  95. keyword whole TIMESTAMPTZ white
  96. keyword whole TIME white
  97. keyword whole ZONE white
  98. keyword whole INTERVAL white
  99. keyword whole DECIMAL white
  100. keyword whole DEC white
  101. keyword whole NUMERIC white
  102. keyword whole STRING white
  103. keyword whole CHAR white
  104. keyword whole VARCHAR white
  105. keyword whole ARRAY white
  106. keyword whole STRUCT white
  107. keyword whole MAP white
  108. keyword whole UNIONTYPE white
  109. keyword whole REDUCE white
  110. keyword whole PARTITIONED white
  111. keyword whole CLUSTERED white
  112. keyword whole SORTED white
  113. keyword whole INTO white
  114. keyword whole BUCKETS white
  115. keyword whole ROW magenta
  116. keyword whole ROWS magenta
  117. keyword whole FORMAT magenta
  118. keyword whole DELIMITED magenta
  119. keyword whole FIELDS magenta
  120. keyword whole TERMINATED magenta
  121. keyword whole ESCAPED magenta
  122. keyword whole COLLECTION white
  123. keyword whole ITEMS white
  124. keyword whole KEYS white
  125. keyword whole $KEY$ white
  126. keyword whole LINES magenta
  127. keyword whole STORED magenta
  128. keyword whole FILEFORMAT magenta
  129. keyword whole INPUTFORMAT magenta
  130. keyword whole OUTPUTFORMAT magenta
  131. keyword whole INPUTDRIVER white
  132. keyword whole OUTPUTDRIVER white
  133. keyword whole ENABLE white
  134. keyword whole DISABLE white
  135. keyword whole LOCATION magenta
  136. keyword whole TABLESAMPLE white
  137. keyword whole BUCKET white
  138. keyword whole OUT white
  139. keyword whole OF white
  140. keyword whole PERCENT white
  141. keyword whole CAST cyan
  142. keyword whole ADD white
  143. keyword whole REPLACE white
  144. keyword whole RLIKE white
  145. keyword whole REGEXP white
  146. keyword whole TEMPORARY white
  147. keyword whole FUNCTION white
  148. keyword whole MACRO white
  149. keyword whole FILE white
  150. keyword whole JAR white
  151. keyword whole EXPLAIN white
  152. keyword whole EXTENDED white
  153. keyword whole FORMATTED white
  154. keyword whole PRETTY white
  155. keyword whole DEPENDENCY white
  156. keyword whole LOGICAL white
  157. keyword whole SERDE white
  158. keyword whole WITH white
  159. keyword whole DEFERRED white
  160. keyword whole SERDEPROPERTIES white
  161. keyword whole DBPROPERTIES white
  162. keyword whole LIMIT white
  163. keyword whole OFFSET white
  164. keyword whole SET white
  165. keyword whole UNSET white
  166. keyword whole TBLPROPERTIES white
  167. keyword whole IDXPROPERTIES white
  168. keyword whole $VALUE$ white
  169. keyword whole $ELEM$ white
  170. keyword whole DEFINED white
  171. keyword whole CASE white
  172. keyword whole WHEN white
  173. keyword whole THEN white
  174. keyword whole ELSE white
  175. keyword whole END white
  176. keyword whole MAPJOIN white
  177. keyword whole STREAMTABLE white
  178. keyword whole CLUSTERSTATUS white
  179. keyword whole UTC white
  180. keyword whole UTC_TMESTAMP white
  181. keyword whole LONG white
  182. keyword whole DELETE white
  183. keyword whole PLUS white
  184. keyword whole MINUS white
  185. keyword whole FETCH white
  186. keyword whole INTERSECT white
  187. keyword whole VIEW white
  188. keyword whole VIEWS white
  189. keyword whole IN white
  190. keyword whole DATABASE white
  191. keyword whole DATABASES white
  192. keyword whole MATERIALIZED white
  193. keyword whole SCHEMA white
  194. keyword whole SCHEMAS white
  195. keyword whole GRANT white
  196. keyword whole REVOKE white
  197. keyword whole SSL white
  198. keyword whole UNDO white
  199. keyword whole LOCK white
  200. keyword whole LOCKS white
  201. keyword whole UNLOCK white
  202. keyword whole SHARED white
  203. keyword whole EXCLUSIVE white
  204. keyword whole PROCEDURE white
  205. keyword whole UNSIGNED white
  206. keyword whole WHILE white
  207. keyword whole READ white
  208. keyword whole READS white
  209. keyword whole PURGE white
  210. keyword whole RANGE white
  211. keyword whole ANALYZE white
  212. keyword whole BEFORE white
  213. keyword whole BETWEEN white
  214. keyword whole BOTH white
  215. keyword whole BINARY white
  216. keyword whole CROSS white
  217. keyword whole CONTINUE white
  218. keyword whole CURSOR white
  219. keyword whole TRIGGER white
  220. keyword whole RECORDREADER white
  221. keyword whole RECORDWRITER white
  222. keyword whole SEMI white
  223. keyword whole LATERAL magenta
  224. keyword whole TOUCH white
  225. keyword whole ARCHIVE magenta
  226. keyword whole UNARCHIVE magenta
  227. keyword whole COMPUTE white
  228. keyword whole STATISTICS white
  229. keyword whole USE magenta
  230. keyword whole OPTION white
  231. keyword whole CONCATENATE magenta
  232. keyword whole SHOW_DATABASE white
  233. keyword whole UPDATE white
  234. keyword whole RESTRICT white
  235. keyword whole CASCADE white
  236. keyword whole SKEWED white
  237. keyword whole ROLLUP white
  238. keyword whole CUBE white
  239. keyword whole DIRECTORIES white
  240. keyword whole FOR white
  241. keyword whole WINDOW white
  242. keyword whole UNBOUNDED white
  243. keyword whole PRECEDING white
  244. keyword whole FOLLOWING white
  245. keyword whole CURRENT white
  246. keyword whole CURRENT_DATE white
  247. keyword whole CURRENT_TIMESTAMP white
  248. keyword whole LESS white
  249. keyword whole MORE white
  250. keyword whole OVER white
  251. keyword whole GROUPING white
  252. keyword whole SETS white
  253. keyword whole TRUNCATE white
  254. keyword whole NOSCAN white
  255. keyword whole PARTIALSCAN white
  256. keyword whole USER white
  257. keyword whole ROLE white
  258. keyword whole ROLES white
  259. keyword whole INNER white
  260. keyword whole EXCHANGE white
  261. keyword whole URI white
  262. keyword whole SERVER white
  263. keyword whole ADMIN white
  264. keyword whole OWNER white
  265. keyword whole PRINCIPALS white
  266. keyword whole COMPACT white
  267. keyword whole COMPACTIONS white
  268. keyword whole TRANSACTIONS white
  269. keyword whole REWRITE white
  270. keyword whole AUTHORIZATION white
  271. keyword whole CONF white
  272. keyword whole VALUES white
  273. keyword whole RELOAD white
  274. keyword whole YEAR white
  275. keyword whole YEARS white
  276. keyword whole QUARTER white
  277. keyword whole MONTH white
  278. keyword whole MONTHS white
  279. keyword whole WEEK white
  280. keyword whole WEEKS white
  281. keyword whole DAY white
  282. keyword whole DAYS white
  283. keyword whole DAYOFWEEK white
  284. keyword whole HOUR white
  285. keyword whole HOURS white
  286. keyword whole MINUTE white
  287. keyword whole MINUTES white
  288. keyword whole SECOND white
  289. keyword whole SECONDS white
  290. keyword whole START white
  291. keyword whole TRANSACTION white
  292. keyword whole COMMIT white
  293. keyword whole ROLLBACK white
  294. keyword whole WORK white
  295. keyword whole ONLY white
  296. keyword whole WRITE white
  297. keyword whole ISOLATION white
  298. keyword whole LEVEL white
  299. keyword whole SNAPSHOT white
  300. keyword whole AUTOCOMMIT white
  301. keyword whole CACHE white
  302. keyword whole PRIMARY white
  303. keyword whole FOREIGN white
  304. keyword whole REFERENCES white
  305. keyword whole CONSTRAINT white
  306. keyword whole VALIDATE white
  307. keyword whole NOVALIDATE white
  308. keyword whole RELY white
  309. keyword whole NORELY white
  310. keyword whole UNIQUE white
  311. keyword whole KEY white
  312. keyword whole ABORT white
  313. keyword whole EXTRACT white
  314. keyword whole FLOOR white
  315. keyword whole MERGE white
  316. keyword whole MATCHED white
  317. keyword whole REPL white
  318. keyword whole DUMP white
  319. keyword whole STATUS white
  320. keyword whole VECTORIZATION white
  321. keyword whole SUMMARY white
  322. keyword whole OPERATOR white
  323. keyword whole EXPRESSION white
  324. keyword whole DETAIL white
  325. keyword whole WAIT white
  326. # Storage Formats
  327. keyword whole TEXTFILE brightblue
  328. keyword whole ORC brightblue
  329. keyword whole SEQUENCEFILE brightblue
  330. keyword whole RCFILE brightblue
  331. keyword whole PARQUET brightblue
  332. keyword whole AVRO brightblue
  333. # Comments
  334. keyword /\* brown
  335. keyword \*/ brown
  336. keyword -- brown
  337. # Operators
  338. keyword > brightcyan
  339. keyword < brightcyan
  340. keyword \+ brightcyan
  341. keyword - brightcyan
  342. keyword \* brightcyan
  343. keyword / brightcyan
  344. keyword % brightcyan
  345. keyword = brightcyan
  346. keyword ( brightcyan
  347. keyword ) brightcyan
  348. keyword , brightcyan
  349. keyword ; brightcyan
  350. keyword . white
  351. keyword \| white
  352. keyword != white
  353. keyword \^ white
  354. keyword \~ white
  355. keyword whole DIV white
  356. keyword [ brightcyan
  357. keyword ] brightcyan
  358. keyword { brightcyan
  359. keyword } brightcyan
  360. keyword : white
  361. keyword & white
  362. keyword ? white
  363. # Mathematical Functions
  364. keyword whole round yellow
  365. keyword whole bround yellow
  366. keyword whole floor yellow
  367. keyword whole ceil yellow
  368. keyword whole rand yellow
  369. keyword whole exp yellow
  370. keyword whole ln yellow
  371. keyword whole log10 yellow
  372. keyword whole log2 yellow
  373. keyword whole log yellow
  374. keyword whole pow yellow
  375. keyword whole sqrt yellow
  376. keyword whole bin yellow
  377. keyword whole hex yellow
  378. keyword whole unhex yellow
  379. keyword whole conv yellow
  380. keyword whole abs yellow
  381. keyword whole pmod yellow
  382. keyword whole sin yellow
  383. keyword whole asin yellow
  384. keyword whole cos yellow
  385. keyword whole acos yellow
  386. keyword whole tan yellow
  387. keyword whole atan yellow
  388. keyword whole degrees yellow
  389. keyword whole radians yellow
  390. keyword whole positive yellow
  391. keyword whole negative yellow
  392. keyword whole sign yellow
  393. keyword whole e() yellow
  394. keyword whole pi() yellow
  395. keyword whole factorial yellow
  396. keyword whole cbrt yellow
  397. keyword whole shiftleft yellow
  398. keyword whole shiftright yellow
  399. keyword whole shiftrightunsigned yellow
  400. keyword whole greatest yellow
  401. keyword whole least yellow
  402. keyword whole width_bucket yellow
  403. # Collection Functions
  404. keyword whole size yellow
  405. keyword whole map_keys yellow
  406. keyword whole map_values yellow
  407. keyword whole array_contains yellow
  408. keyword whole sort_array yellow
  409. # Type Conversion
  410. # binary # keyword
  411. # cast # keyword
  412. # Date Functions
  413. keyword whole from_unixtime yellow
  414. keyword whole unix_timestamp yellow
  415. keyword whole to_date yellow
  416. keyword whole year yellow
  417. keyword whole quarter yellow
  418. keyword whole month yellow
  419. keyword whole day yellow
  420. keyword whole hour yellow
  421. keyword whole minute yellow
  422. keyword whole second yellow
  423. keyword whole weekofyear yellow
  424. keyword whole extract yellow
  425. keyword whole datediff yellow
  426. keyword whole date_add yellow
  427. keyword whole date_sub yellow
  428. keyword whole from_utc_timestamp yellow
  429. keyword whole to_utc_timestamp yellow
  430. keyword whole current_date yellow
  431. keyword whole add_months yellow
  432. keyword whole last_day yellow
  433. keyword whole next_day yellow
  434. keyword whole trunc yellow
  435. keyword whole months_between yellow
  436. keyword whole date_format yellow
  437. # Conditional Functions
  438. keyword whole if yellow
  439. keyword whole isnull yellow
  440. keyword whole isnotnull yellow
  441. keyword whole coalesce yellow
  442. keyword whole nullif yellow
  443. keyword whole assert_true yellow
  444. # String Functions
  445. keyword whole ascii yellow
  446. keyword whole base64 yellow
  447. keyword whole character_length yellow
  448. keyword whole chr yellow
  449. keyword whole concat yellow
  450. keyword whole context_ngrams yellow
  451. keyword whole concat_ws yellow
  452. keyword whole decode yellow
  453. keyword whole elt yellow
  454. keyword whole encode yellow
  455. keyword whole field yellow
  456. keyword whole find_in_set yellow
  457. keyword whole format_number yellow
  458. keyword whole get_json_object yellow
  459. keyword whole in_file yellow
  460. keyword whole instr yellow
  461. keyword whole length yellow
  462. keyword whole locate yellow
  463. keyword whole lower yellow
  464. keyword whole lpad yellow
  465. keyword whole ltrim yellow
  466. keyword whole ngrams yellow
  467. keyword whole octet_length yellow
  468. keyword whole parse_url yellow
  469. keyword whole printf yellow
  470. keyword whole regexp_extract yellow
  471. keyword whole regexp_replace yellow
  472. keyword whole repeat yellow
  473. keyword whole replace yellow
  474. keyword whole reverse yellow
  475. keyword whole rpad yellow
  476. keyword whole rtrim yellow
  477. keyword whole sentences yellow
  478. keyword whole space yellow
  479. keyword whole split yellow
  480. keyword whole str_to_map yellow
  481. keyword whole substr yellow
  482. keyword whole substr_index yellow
  483. keyword whole translate yellow
  484. keyword whole trim yellow
  485. keyword whole unbase64 yellow
  486. keyword whole upper yellow
  487. keyword whole initcap yellow
  488. keyword whole levenshtein yellow
  489. keyword whole soundex yellow
  490. # Data Masking Functions
  491. keyword whole mask yellow
  492. keyword whole mask_first_n yellow
  493. keyword whole mask_last_n yellow
  494. keyword whole mask_show_first_n yellow
  495. keyword whole mask_show_last_n yellow
  496. keyword whole mask_hash yellow
  497. # Misc. Functions
  498. keyword whole java_method yellow
  499. keyword whole reflect yellow
  500. keyword whole hash yellow
  501. keyword whole current_user yellow
  502. keyword whole logged_user yellow
  503. keyword whole md5 yellow
  504. keyword whole sha1 yellow
  505. keyword whole sha yellow
  506. keyword whole crc32 yellow
  507. keyword whole sha2 yellow
  508. keyword whole aes_encrypt yellow
  509. keyword whole aes_decrypt yellow
  510. keyword whole version yellow
  511. # xpath
  512. keyword whole xpath yellow
  513. keyword whole xpath_short yellow
  514. keyword whole xpath_int yellow
  515. keyword whole xpath_long yellow
  516. keyword whole xpath_float yellow
  517. keyword whole xpath_double yellow
  518. keyword whole xpath_number yellow
  519. keyword whole xpath_string yellow
  520. # Aggregate Functions
  521. keyword whole count yellow
  522. keyword whole sum yellow
  523. keyword whole avg yellow
  524. keyword whole min yellow
  525. keyword whole max yellow
  526. keyword whole variance yellow
  527. keyword whole var_samp yellow
  528. keyword whole stddev_pop yellow
  529. keyword whole stddev_samp yellow
  530. keyword whole covar_pop yellow
  531. keyword whole covar_samp yellow
  532. keyword whole corr yellow
  533. keyword whole percentile yellow
  534. keyword whole regr_avgx yellow
  535. keyword whole regr_avgy yellow
  536. keyword whole regr_count yellow
  537. keyword whole regr_intercept yellow
  538. keyword whole regr_r2 yellow
  539. keyword whole regr_slope yellow
  540. keyword whole regr_sxx yellow
  541. keyword whole regr_sxy yellow
  542. keyword whole regr_syy yellow
  543. keyword whole histogram_numeric yellow
  544. keyword whole collect_set yellow
  545. keyword whole collect_list yellow
  546. keyword whole ntile yellow
  547. # Table-Generating Functions
  548. keyword whole explode yellow
  549. keyword whole posexplode yellow
  550. keyword whole inline yellow
  551. keyword whole stack yellow
  552. keyword whole json_tuple yellow
  553. keyword whole parse_url yellow
  554. # Window Functions
  555. keyword whole lead yellow
  556. keyword whole lag yellow
  557. keyword whole first_value yellow
  558. keyword whole last_value yellow
  559. keyword whole rank yellow
  560. keyword whole row_number yellow
  561. keyword whole dense_rank yellow
  562. keyword whole cume_dist yellow
  563. keyword whole percent_rank yellow
  564. keyword whole ntile yellow
  565. # Variables
  566. # oozie variables
  567. keyword whole ${+} brightgreen
  568. # hive variables
  569. keyword whole ${hiveconf:+} magenta
  570. # Hive options
  571. keyword wholeright hive.+.+.+ red
  572. keyword wholeright tez.+.+ red
  573. keyword wholeright mapreduce.+.+ red
  574. # Literals
  575. # float
  576. keyword whole \[0123456789\]\{.\}\[0123456789\] brightmagenta
  577. # float e notation
  578. keyword whole \[0123456789\]\[.\]\[0123456789\]\{e\}\[\+-\]\{0123456789\}\[0123456789\] brightmagenta
  579. # tinyint
  580. keyword whole \{0123456789\}\[0123456789\]Y magenta
  581. # smallint
  582. keyword whole \{0123456789\}\[0123456789\]S magenta
  583. # bigint
  584. keyword whole \{0123456789\}\[0123456789\]L magenta
  585. # int
  586. keyword whole \{0123456789\}\[0123456789\] brightmagenta
  587. # big decimal
  588. keyword whole \{0123456789\}\[0123456789\]BD magenta
  589. context exclusive -- \n brown
  590. spellcheck
  591. context exclusive /\* \*/ brown
  592. spellcheck
  593. context ' ' green
  594. keyword \\' brightgreen
  595. # oozie variables
  596. keyword whole ${+} brightgreen
  597. # hive variables
  598. keyword whole ${hiveconf:+} magenta
  599. context " " red
  600. keyword \\" brightred