Pārlūkot izejas kodu

HUE-9679 [ui] Add 'show tables' to autocomplete for Flink (#1610)

Asnaik HWX 4 gadi atpakaļ
vecāks
revīzija
c094d271fa

+ 41 - 0
desktop/core/src/desktop/js/parse/jison/sql/flink/sql_show.jison

@@ -0,0 +1,41 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : 'SHOW' ShowStatement
+ ;
+
+DataDefinition_EDIT
+ : ShowStatement_EDIT
+ ;
+
+ShowStatement
+ : 'TABLES'
+ | 'CATALOGS' 
+ | 'CURRENT CATALOG'
+ | 'DATABASES'
+ | 'CURRENT DATABASE'
+ | 'TABLES'
+ | 'VIEWS'
+ | 'FUNCTIONS'
+ ;
+
+ShowStatement_EDIT
+: 'SHOW' 'CURSOR'
+   {
+     parser.suggestKeywords(['TABLES', 'CATALOGS', 'CURRENT CATALOG', 'DATABASES', 'CURRENT DATABASE', 'VIEWS', 'FUNCTIONS']);
+   }
+ ;

+ 2 - 0
desktop/core/src/desktop/js/parse/jison/sql/flink/structure.json

@@ -53,6 +53,7 @@
     "../generic/use/use.jison",
     "../generic/sql_error.jison",
     "../generic/sql_main.jison",
+    "sql_show.jison",
     "../generic/sql_valueExpression.jison",
     "../generic/autocomplete_footer.jison"
   ],
@@ -108,6 +109,7 @@
     "../generic/update/update_table.jison",
     "../generic/use/use.jison",
     "../generic/sql_main.jison",
+    "sql_show.jison",
     "../generic/sql_valueExpression.jison",
     "../generic/syntax_footer.jison"
   ]

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/flink/flinkAutocompleteParser.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/flink/flinkSyntaxParser.js


+ 6 - 192
tools/jison/package-lock.json

@@ -1,195 +1,19 @@
 {
   "name": "parser-generator",
   "version": "1.0.0",
-  "lockfileVersion": 2,
+  "lockfileVersion": 1,
   "requires": true,
-  "packages": {
-    "": {
-      "name": "parser-generator",
-      "version": "1.0.0",
-      "license": "ISC",
-      "dependencies": {
-        "jison": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e"
-      }
-    },
-    "node_modules/amdefine": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
-      "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
-      "optional": true,
-      "engines": {
-        "node": ">=0.4.2"
-      }
-    },
-    "node_modules/cjson": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz",
-      "integrity": "sha1-5kObkHA9MS/24iJAl76pLOPQKhQ=",
-      "dependencies": {
-        "jsonlint": "1.6.0"
-      },
-      "engines": {
-        "node": ">= 0.3.0"
-      }
-    },
-    "node_modules/colors": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz",
-      "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=",
-      "engines": {
-        "node": ">=0.1.90"
-      }
-    },
-    "node_modules/ebnf-parser": {
-      "version": "0.1.10",
-      "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz",
-      "integrity": "sha1-zR9rpHfFY4xAyX7ZtXLbW6tdgzE="
-    },
-    "node_modules/escodegen": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz",
-      "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=",
-      "dependencies": {
-        "esprima": "~1.1.1",
-        "estraverse": "~1.5.0",
-        "esutils": "~1.0.0",
-        "source-map": "~0.1.33"
-      },
-      "bin": {
-        "escodegen": "bin/escodegen.js",
-        "esgenerate": "bin/esgenerate.js"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      },
-      "optionalDependencies": {
-        "source-map": "~0.1.33"
-      }
-    },
-    "node_modules/esprima": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz",
-      "integrity": "sha1-W28VR/TRAuZw4UDFCb5ncdautUk=",
-      "bin": {
-        "esparse": "bin/esparse.js",
-        "esvalidate": "bin/esvalidate.js"
-      },
-      "engines": {
-        "node": ">=0.4.0"
-      }
-    },
-    "node_modules/estraverse": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
-      "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=",
-      "engines": {
-        "node": ">=0.4.0"
-      }
-    },
-    "node_modules/esutils": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
-      "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/jison": {
-      "resolved": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e",
-      "integrity": "sha512-kKqzzhj1GaVw5vTDQWV3pvKjJS9v5fheDNyN8h3CLj3mHZhbcw2Kb8iT+wPlpCJhbZ3HIxoVJFbmwg7z+ZvGrg==",
-      "dependencies": {
-        "cjson": "0.3.0",
-        "ebnf-parser": "0.1.10",
-        "escodegen": "1.3.x",
-        "esprima": "1.1.x",
-        "jison-lex": "0.3.x",
-        "JSONSelect": "0.4.0",
-        "lex-parser": "~0.1.3",
-        "nomnom": "1.5.2"
-      },
-      "bin": {
-        "jison": "lib/cli.js"
-      },
-      "engines": {
-        "node": ">=0.4"
-      }
-    },
-    "node_modules/jison-lex": {
-      "version": "0.3.4",
-      "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz",
-      "integrity": "sha1-gcoo2E+ESZ36jFlNzePYo/Jux6U=",
-      "dependencies": {
-        "lex-parser": "0.1.x",
-        "nomnom": "1.5.2"
-      },
-      "bin": {
-        "jison-lex": "cli.js"
-      },
-      "engines": {
-        "node": ">=0.4"
-      }
-    },
-    "node_modules/jsonlint": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz",
-      "integrity": "sha1-iKpGvCiaesk7tGyuLVihh6m7SUo=",
-      "dependencies": {
-        "JSV": ">= 4.0.x",
-        "nomnom": ">= 1.5.x"
-      },
-      "bin": {
-        "jsonlint": "lib/cli.js"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/JSONSelect": {
+  "dependencies": {
+    "JSONSelect": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz",
-      "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40=",
-      "engines": {
-        "node": ">=0.4.7"
-      }
+      "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40="
     },
-    "node_modules/JSV": {
+    "JSV": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz",
       "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c="
     },
-    "node_modules/lex-parser": {
-      "version": "0.1.4",
-      "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz",
-      "integrity": "sha1-ZMTwJfF/1Tv7RXY/rrFvAVp0dVA="
-    },
-    "node_modules/nomnom": {
-      "version": "1.5.2",
-      "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz",
-      "integrity": "sha1-9DRUSKhTz71cDSYyDyR3qwUm/i8=",
-      "dependencies": {
-        "colors": "0.5.x",
-        "underscore": "1.1.x"
-      }
-    },
-    "node_modules/source-map": {
-      "version": "0.1.43",
-      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
-      "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
-      "optional": true,
-      "dependencies": {
-        "amdefine": ">=0.0.4"
-      },
-      "engines": {
-        "node": ">=0.8.0"
-      }
-    },
-    "node_modules/underscore": {
-      "version": "1.1.7",
-      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz",
-      "integrity": "sha1-QLq4S60Z0jAJbo1u9ii/8FXYPbA="
-    }
-  },
-  "dependencies": {
     "amdefine": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
@@ -244,12 +68,12 @@
       "version": "https://github.com/JohanAhlen/jison/tarball/ad8e41475e",
       "integrity": "sha512-kKqzzhj1GaVw5vTDQWV3pvKjJS9v5fheDNyN8h3CLj3mHZhbcw2Kb8iT+wPlpCJhbZ3HIxoVJFbmwg7z+ZvGrg==",
       "requires": {
+        "JSONSelect": "0.4.0",
         "cjson": "0.3.0",
         "ebnf-parser": "0.1.10",
         "escodegen": "1.3.x",
         "esprima": "1.1.x",
         "jison-lex": "0.3.x",
-        "JSONSelect": "0.4.0",
         "lex-parser": "~0.1.3",
         "nomnom": "1.5.2"
       }
@@ -272,16 +96,6 @@
         "nomnom": ">= 1.5.x"
       }
     },
-    "JSONSelect": {
-      "version": "0.4.0",
-      "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz",
-      "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40="
-    },
-    "JSV": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz",
-      "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c="
-    },
     "lex-parser": {
       "version": "0.1.4",
       "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz",

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels