From: Andreas Gerler Date: Wed, 7 Feb 2018 14:16:27 +0000 (+0100) Subject: vertica-snippets update. X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=f1202a767a4b9674fa52341a03ee7aee6b0a38c5;p=emacsconfig.git vertica-snippets update. Signed-off-by: Andreas Gerler --- diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/check_rle_overridden b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/check_rle_overridden deleted file mode 100644 index 962da6a9..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/check_rle_overridden +++ /dev/null @@ -1,21 +0,0 @@ -# -*- mode: snippet -*- -# name: check_rle_overridden -# key: rle_check_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -select - qe.user_name, - count(*) -from - v_monitor.query_events qe - join v_monitor.query_requests qr - on qr.transaction_id = qe.transaction_id - and qr.statement_id = qe.statement_id -where - qr.request_type = 'QUERY' - and qe.event_type = 'RLE_OVERRIDDEN' - and to_char(event_timestamp, 'YYYY-MM-DD') = '${1:`(format-time-string "%Y-%m-%d")`}' -group by - 1 -; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/current_epoch b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/current_epoch deleted file mode 100644 index cd4550fb..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/current_epoch +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: current_epoch -# key: epo_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT current_epoch, ahm_epoch, last_good_epoch FROM v_monitor.system; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/errors b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/errors deleted file mode 100644 index f5629f08..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/errors +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: errors -# key: errors_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT DISTINCT error_level, message FROM error_messages $0WHERE message ILIKE 'Vertica suggests%'; diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-partitions b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-partitions deleted file mode 100644 index dadd295e..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-partitions +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: get-partitions -# key: get-part -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM v_monitor.partitions WHERE table_schema = '$1' AND projection_name LIKE '%$2%';$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-projections b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-projections deleted file mode 100644 index c4457800..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/get-projections +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: get-projections -# key: get-proj -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT GET_PROJECTIONS('$1');$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/grants b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/grants deleted file mode 100644 index 96d0003b..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/grants +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: grants -# key: grants_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT grantee, object_name, privileges_description FROM v_catalog.grants WHERE object_type = '${1:$$(yas-choose-value '("RESOURCEPOOL" "ROLE" "SCHEMA" "TABLE" "VIEW" "STORAGELOCATION"))}' ORDER BY grantee $0LIMIT 50; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/nodes b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/nodes deleted file mode 100644 index 7ef2cc9c..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/nodes +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: show nodes -# key: nodes_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM nodes; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/rebalance_status b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/rebalance_status deleted file mode 100644 index 9c014ca2..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/rebalance_status +++ /dev/null @@ -1,26 +0,0 @@ -# -*- mode: snippet -*- -# name: rebalance_status -# key: rebalance_status_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT rebalance_method rebalance_method, - status, - count(*) AS COUNT -FROM - (SELECT rebalance_method, - CASE - WHEN (separated_percent = 100 - AND transferred_percent = 100) THEN 'Completed' - WHEN (separated_percent <> 0 - AND separated_percent <> 100) - OR (transferred_percent <> 0 - AND transferred_percent <> 100) THEN 'In Progress' - ELSE 'Queued' - END AS status - FROM rebalance_projection_status - WHERE is_latest) AS tab -GROUP BY 1, - 2 -ORDER BY 1, - 2;$0 diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resource-pool-move b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resource-pool-move deleted file mode 100644 index 5486fe9c..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resource-pool-move +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: resource-pool-move -# key: rpmv -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM resource_pool_move ORDER BY move_timestamp DESC LIMIT 40;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resources b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resources deleted file mode 100644 index 16474d2d..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/resources +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: resources -# key: res_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM ${1:$$(yas-choose-value '("resource_pool_status" "resource_pool_move" "resource_rejections" "resource_rejection_details ORDER BY 1"))};$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/sessions b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/sessions deleted file mode 100644 index 529f7a6b..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/sessions +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: sessions -# key: sess_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM sessions;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-containers b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-containers deleted file mode 100644 index 5bb25bb8..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-containers +++ /dev/null @@ -1,19 +0,0 @@ -# -*- mode: snippet -*- -# name: storage-containers -# key: storage-containers -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT s.node_name, - p.table_schema, - s.projection_name, - count(DISTINCT s.storage_oid) storage_container_count, - count(DISTINCT partition_key) partition_count, - count(r.rosid) ros_file_count -FROM storage_containers s -LEFT OUTER JOIN partitions p ON s.storage_oid = p.ros_id -JOIN vs_ros r ON r.delid = s.storage_oid -GROUP BY 1, - 2, - 3 -ORDER BY 4 DESC LIMIT 50;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-locations b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-locations deleted file mode 100644 index 291fa405..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/storage-locations +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: storage-locations -# key: storage-locations -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT * FROM v_catalog.grants gra, storage_locations loc WHERE gra.object_id = loc.location_id;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/user_sessions b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/user_sessions deleted file mode 100644 index 29444569..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/user_sessions +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: user_sessions -# key: ussess_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT session_id, transaction_start FROM sessions WHERE user_name = '$1' ORDER BY 2 desc;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/vertica_users b/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/vertica_users deleted file mode 100644 index 73414e02..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-interactive-mode/vertica_users +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: vertica_users -# key: vertu_ -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT user_name,resource_pool,default_roles FROM v_catalog.users ORDER BY 1; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180122.44/snippets/sql-mode/.yas-parents b/elpa/vertica-snippets-20180122.44/snippets/sql-mode/.yas-parents deleted file mode 100644 index a20f5c60..00000000 --- a/elpa/vertica-snippets-20180122.44/snippets/sql-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -sql-interactive-mode diff --git a/elpa/vertica-snippets-20180122.44/vertica-snippets-autoloads.el b/elpa/vertica-snippets-20180122.44/vertica-snippets-autoloads.el deleted file mode 100644 index cba7932b..00000000 --- a/elpa/vertica-snippets-20180122.44/vertica-snippets-autoloads.el +++ /dev/null @@ -1,29 +0,0 @@ -;;; vertica-snippets-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "vertica-snippets" "vertica-snippets.el" (23142 -;;;;;; 1522 96098 505000)) -;;; Generated autoloads from vertica-snippets.el - -(autoload 'vertica-snippets-initialize "vertica-snippets" "\ -Add snippet dir to yas-snippet-dirs and load it. - -\(fn)" nil nil) - -(eval-after-load 'yasnippet '(vertica-snippets-initialize)) - -;;;*** - -;;;### (autoloads nil nil ("vertica-snippets-pkg.el") (23142 1522 -;;;;;; 93766 839000)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; vertica-snippets-autoloads.el ends here diff --git a/elpa/vertica-snippets-20180122.44/vertica-snippets-pkg.el b/elpa/vertica-snippets-20180122.44/vertica-snippets-pkg.el deleted file mode 100644 index 16fa0f5a..00000000 --- a/elpa/vertica-snippets-20180122.44/vertica-snippets-pkg.el +++ /dev/null @@ -1,7 +0,0 @@ -(define-package "vertica-snippets" "20180122.44" "Yasnippets for Vertica" - '((yasnippet "0.6.1")) - :url "https://github.com/baron42bba/vertica-snippets" :keywords - '("convenience" "snippets")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/vertica-snippets-20180122.44/vertica-snippets.el b/elpa/vertica-snippets-20180122.44/vertica-snippets.el deleted file mode 100644 index 3826da3a..00000000 --- a/elpa/vertica-snippets-20180122.44/vertica-snippets.el +++ /dev/null @@ -1,55 +0,0 @@ -;;; vertica-snippets.el --- Yasnippets for Vertica - -;; Copyright (C) 2018 Andreas Gerler -;; keywords: convenience,snippets -;; Version: 0.1.0 -;; Package-Requires: ((yasnippet "0.6.1")) - -;; Author: Andreas Gerler -;; Maintainer: Andreas Gerler - -;; URL: https://github.com/baron42bba/vertica-snippets - -;; Permission is hereby granted, free of charge, to any person obtaining -;; a copy of this software and associated documentation files (the -;; "Software"), to deal in the Software without restriction, including -;; without limitation the rights to use, copy, modify, merge, publish, -;; distribute, sublicense, and/or sell copies of the Software, and to -;; permit persons to whom the Software is furnished to do so, subject to -;; the following conditions: - -;; The above copyright notice and this permission notice shall be -;; included in all copies or substantial portions of the Software. - -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -;;; Commentary: - -;; A collection of yasnippet snippets to be used with the Vertica Analytics Platform - -;;; Code: - -(require 'yasnippet) - -(defvar vertica-snippets-dir (file-name-directory (or (buffer-file-name) - load-file-name))) - -;;;###autoload -(defun vertica-snippets-initialize () - "Add snippet dir to yas-snippet-dirs and load it." - (let ((snip-dir (expand-file-name "snippets" vertica-snippets-dir))) - (add-to-list 'yas-snippet-dirs snip-dir t) - (yas-load-directory snip-dir))) - -;;;###autoload -(eval-after-load 'yasnippet - '(vertica-snippets-initialize)) - -(provide 'vertica-snippets) -;;; vertica-snippets.el ends here diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/check_rle_overridden b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/check_rle_overridden new file mode 100644 index 00000000..962da6a9 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/check_rle_overridden @@ -0,0 +1,21 @@ +# -*- mode: snippet -*- +# name: check_rle_overridden +# key: rle_check_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +select + qe.user_name, + count(*) +from + v_monitor.query_events qe + join v_monitor.query_requests qr + on qr.transaction_id = qe.transaction_id + and qr.statement_id = qe.statement_id +where + qr.request_type = 'QUERY' + and qe.event_type = 'RLE_OVERRIDDEN' + and to_char(event_timestamp, 'YYYY-MM-DD') = '${1:`(format-time-string "%Y-%m-%d")`}' +group by + 1 +; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/current_epoch b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/current_epoch new file mode 100644 index 00000000..cd4550fb --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/current_epoch @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: current_epoch +# key: epo_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT current_epoch, ahm_epoch, last_good_epoch FROM v_monitor.system; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/errors b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/errors new file mode 100644 index 00000000..f5629f08 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/errors @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: errors +# key: errors_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT DISTINCT error_level, message FROM error_messages $0WHERE message ILIKE 'Vertica suggests%'; diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-partitions b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-partitions new file mode 100644 index 00000000..dadd295e --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-partitions @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: get-partitions +# key: get-part +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM v_monitor.partitions WHERE table_schema = '$1' AND projection_name LIKE '%$2%';$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-projections b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-projections new file mode 100644 index 00000000..c4457800 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/get-projections @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: get-projections +# key: get-proj +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT GET_PROJECTIONS('$1');$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/grants b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/grants new file mode 100644 index 00000000..96d0003b --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/grants @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: grants +# key: grants_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT grantee, object_name, privileges_description FROM v_catalog.grants WHERE object_type = '${1:$$(yas-choose-value '("RESOURCEPOOL" "ROLE" "SCHEMA" "TABLE" "VIEW" "STORAGELOCATION"))}' ORDER BY grantee $0LIMIT 50; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/nodes b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/nodes new file mode 100644 index 00000000..7ef2cc9c --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/nodes @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: show nodes +# key: nodes_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM nodes; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/query-times b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/query-times new file mode 100644 index 00000000..be328687 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/query-times @@ -0,0 +1,27 @@ +# -*- mode: snippet -*- +# name: query-times +# key: qt_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT DISTINCT theday, + user_name, + (min_dat / 1000) AS min_sec, + (max_dat / 1000) AS max_sec, + (avg_dat / 1000) AS avg_sec, + (median_dat / 1000) AS median_sec, + query_cnt +FROM + (SELECT date(end_timestamp::TIMESTAMP) AS theday, + user_name, + min(request_duration_ms) over(partition BY date(end_timestamp::TIMESTAMP), user_name) min_dat, + max(request_duration_ms) over(partition BY date(end_timestamp::TIMESTAMP), user_name) max_dat, + avg(request_duration_ms) over(partition BY date(end_timestamp::TIMESTAMP), user_name) avg_dat, + median(request_duration_ms) over(partition BY date(end_timestamp::TIMESTAMP), user_name) median_dat, + count(*) over(partition BY date(end_timestamp::TIMESTAMP), user_name) AS query_cnt + FROM query_requests + WHERE is_executing IS FALSE + AND request ILIKE '%table%' + AND NOT (request LIKE 'SELECT * FROM columns%' + OR request LIKE '%query_requests%') ) my_alias +ORDER BY 1, 2 DESC; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/rebalance_status b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/rebalance_status new file mode 100644 index 00000000..9c014ca2 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/rebalance_status @@ -0,0 +1,26 @@ +# -*- mode: snippet -*- +# name: rebalance_status +# key: rebalance_status_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT rebalance_method rebalance_method, + status, + count(*) AS COUNT +FROM + (SELECT rebalance_method, + CASE + WHEN (separated_percent = 100 + AND transferred_percent = 100) THEN 'Completed' + WHEN (separated_percent <> 0 + AND separated_percent <> 100) + OR (transferred_percent <> 0 + AND transferred_percent <> 100) THEN 'In Progress' + ELSE 'Queued' + END AS status + FROM rebalance_projection_status + WHERE is_latest) AS tab +GROUP BY 1, + 2 +ORDER BY 1, + 2;$0 diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resource-pool-move b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resource-pool-move new file mode 100644 index 00000000..5486fe9c --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resource-pool-move @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: resource-pool-move +# key: rpmv +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM resource_pool_move ORDER BY move_timestamp DESC LIMIT 40;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resources b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resources new file mode 100644 index 00000000..16474d2d --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/resources @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: resources +# key: res_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM ${1:$$(yas-choose-value '("resource_pool_status" "resource_pool_move" "resource_rejections" "resource_rejection_details ORDER BY 1"))};$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/sessions b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/sessions new file mode 100644 index 00000000..529f7a6b --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/sessions @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: sessions +# key: sess_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM sessions;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-containers b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-containers new file mode 100644 index 00000000..5bb25bb8 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-containers @@ -0,0 +1,19 @@ +# -*- mode: snippet -*- +# name: storage-containers +# key: storage-containers +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT s.node_name, + p.table_schema, + s.projection_name, + count(DISTINCT s.storage_oid) storage_container_count, + count(DISTINCT partition_key) partition_count, + count(r.rosid) ros_file_count +FROM storage_containers s +LEFT OUTER JOIN partitions p ON s.storage_oid = p.ros_id +JOIN vs_ros r ON r.delid = s.storage_oid +GROUP BY 1, + 2, + 3 +ORDER BY 4 DESC LIMIT 50;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-locations b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-locations new file mode 100644 index 00000000..291fa405 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/storage-locations @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: storage-locations +# key: storage-locations +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM v_catalog.grants gra, storage_locations loc WHERE gra.object_id = loc.location_id;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/user_sessions b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/user_sessions new file mode 100644 index 00000000..29444569 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/user_sessions @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: user_sessions +# key: ussess_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT session_id, transaction_start FROM sessions WHERE user_name = '$1' ORDER BY 2 desc;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/vertica_users b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/vertica_users new file mode 100644 index 00000000..73414e02 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-interactive-mode/vertica_users @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: vertica_users +# key: vertu_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT user_name,resource_pool,default_roles FROM v_catalog.users ORDER BY 1; \ No newline at end of file diff --git a/elpa/vertica-snippets-20180207.453/snippets/sql-mode/.yas-parents b/elpa/vertica-snippets-20180207.453/snippets/sql-mode/.yas-parents new file mode 100644 index 00000000..a20f5c60 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/snippets/sql-mode/.yas-parents @@ -0,0 +1 @@ +sql-interactive-mode diff --git a/elpa/vertica-snippets-20180207.453/vertica-snippets-autoloads.el b/elpa/vertica-snippets-20180207.453/vertica-snippets-autoloads.el new file mode 100644 index 00000000..8bfa011e --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/vertica-snippets-autoloads.el @@ -0,0 +1,29 @@ +;;; vertica-snippets-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "vertica-snippets" "vertica-snippets.el" (23163 +;;;;;; 2511 68580 344000)) +;;; Generated autoloads from vertica-snippets.el + +(autoload 'vertica-snippets-initialize "vertica-snippets" "\ +Add snippet dir to yas-snippet-dirs and load it. + +\(fn)" nil nil) + +(eval-after-load 'yasnippet '(vertica-snippets-initialize)) + +;;;*** + +;;;### (autoloads nil nil ("vertica-snippets-pkg.el") (23163 2511 +;;;;;; 67083 188000)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; vertica-snippets-autoloads.el ends here diff --git a/elpa/vertica-snippets-20180207.453/vertica-snippets-pkg.el b/elpa/vertica-snippets-20180207.453/vertica-snippets-pkg.el new file mode 100644 index 00000000..dbf3b5f4 --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/vertica-snippets-pkg.el @@ -0,0 +1,7 @@ +(define-package "vertica-snippets" "20180207.453" "Yasnippets for Vertica" + '((yasnippet "0.6.1")) + :url "https://github.com/baron42bba/vertica-snippets" :keywords + '("convenience" "snippets")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/vertica-snippets-20180207.453/vertica-snippets.el b/elpa/vertica-snippets-20180207.453/vertica-snippets.el new file mode 100644 index 00000000..3826da3a --- /dev/null +++ b/elpa/vertica-snippets-20180207.453/vertica-snippets.el @@ -0,0 +1,55 @@ +;;; vertica-snippets.el --- Yasnippets for Vertica + +;; Copyright (C) 2018 Andreas Gerler +;; keywords: convenience,snippets +;; Version: 0.1.0 +;; Package-Requires: ((yasnippet "0.6.1")) + +;; Author: Andreas Gerler +;; Maintainer: Andreas Gerler + +;; URL: https://github.com/baron42bba/vertica-snippets + +;; Permission is hereby granted, free of charge, to any person obtaining +;; a copy of this software and associated documentation files (the +;; "Software"), to deal in the Software without restriction, including +;; without limitation the rights to use, copy, modify, merge, publish, +;; distribute, sublicense, and/or sell copies of the Software, and to +;; permit persons to whom the Software is furnished to do so, subject to +;; the following conditions: + +;; The above copyright notice and this permission notice shall be +;; included in all copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +;;; Commentary: + +;; A collection of yasnippet snippets to be used with the Vertica Analytics Platform + +;;; Code: + +(require 'yasnippet) + +(defvar vertica-snippets-dir (file-name-directory (or (buffer-file-name) + load-file-name))) + +;;;###autoload +(defun vertica-snippets-initialize () + "Add snippet dir to yas-snippet-dirs and load it." + (let ((snip-dir (expand-file-name "snippets" vertica-snippets-dir))) + (add-to-list 'yas-snippet-dirs snip-dir t) + (yas-load-directory snip-dir))) + +;;;###autoload +(eval-after-load 'yasnippet + '(vertica-snippets-initialize)) + +(provide 'vertica-snippets) +;;; vertica-snippets.el ends here