Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[sql mode] Added support for Hive

  • Loading branch information...
commit 11b4e40e21949b44b70172d4485775c2b7104e48 1 parent a21c491
@malayhm malayhm authored marijnh committed
Showing with 13 additions and 1 deletion.
  1. +2 −1  mode/sql/index.html
  2. +11 −0 mode/sql/sql.js
View
3  mode/sql/index.html
@@ -52,7 +52,8 @@
<code><a href="?mime=text/x-mariadb">text/x-mariadb</a></code>,
<code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>,
<code><a href="?mime=text/x-plsql">text/x-plsql</a></code>,
- <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>.
+ <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>,
+ <code><a href="?mime=text/x-hive">text/x-hive</a></code>.
</p>
<script>
window.onload = function() {
View
11 mode/sql/sql.js
@@ -332,6 +332,17 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
dateSQL: set("date time timestamp"),
support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")
});
+
+ // Created to support specific hive keywords
+ CodeMirror.defineMIME("text/x-hive", {
+ name: "sql",
+ keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),
+ builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),
+ atoms: set("false true null unknown"),
+ operatorChars: /^[*+\-%<>!=]/,
+ dateSQL: set("date timestamp"),
+ support: set("ODBCdotTable doubleQuote binaryNumber hexNumber")
+ });
}());
/*
Please sign in to comment.
Something went wrong with that request. Please try again.