From: Andreas Gerler Date: Sat, 22 Dec 2018 14:01:04 +0000 (+0100) Subject: update vertica-snippets X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=db334cd5c93c713bb657377e3d2a2413b4522b20;p=emacsconfig.git update vertica-snippets Signed-off-by: Andreas Gerler --- diff --git a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/check_rle_overridden b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/check_rle_overridden deleted file mode 100644 index 962da6a9..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/current_epoch b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/current_epoch deleted file mode 100644 index cd4550fb..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/errors b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/errors deleted file mode 100644 index f5629f08..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/get-partitions b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/get-partitions deleted file mode 100644 index dadd295e..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/get-projections b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/get-projections deleted file mode 100644 index c4457800..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/grants b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/grants deleted file mode 100644 index 96d0003b..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/last-statement-timing b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/last-statement-timing deleted file mode 100644 index c598f2ef..00000000 --- a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/last-statement-timing +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: last-statement-timing -# key: lst_ -# group: vertica -# -- -SELECT last_statement, - last_statement_duration_us / 1000000.0 last_statement_duration_seconds -FROM current_session; \ No newline at end of file diff --git a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/list-tables-row-count-size b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/list-tables-row-count-size deleted file mode 100644 index 6cc9169c..00000000 --- a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/list-tables-row-count-size +++ /dev/null @@ -1,15 +0,0 @@ -# -*- mode: snippet -*- -# name: list-tables-row-count-size -# key: ls-tables -# group: vertica -# condition: (if (string-equal sql-product 'vertica)t) -# -- -SELECT tbl.table_schema AS "Schema Name", - tbl.table_name AS "Table Name", - to_char(sum(prs.ros_row_count)/count(DISTINCT prs.projection_name), '999G999G999G999') AS "No Of Rows", - to_char(sum(prs.ros_used_bytes)/count(DISTINCT prs.projection_name), '999G999G999G999G999') AS "Size In Bytes" -FROM TABLES tbl -JOIN projections prj ON tbl.table_id = prj.anchor_table_id -JOIN projection_storage prs ON prj.projection_name = prs.projection_name -GROUP BY 1, 2 -ORDER BY 1, 2;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/nodes b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/nodes deleted file mode 100644 index 7ef2cc9c..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/query-times b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/query-times deleted file mode 100644 index be328687..00000000 --- a/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/query-times +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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-20181016.748/snippets/sql-interactive-mode/rebalance_status b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/rebalance_status deleted file mode 100644 index 9c014ca2..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/resource-pool-move b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/resource-pool-move deleted file mode 100644 index 5486fe9c..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/resources b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/resources deleted file mode 100644 index 16474d2d..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/sessions b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/sessions deleted file mode 100644 index 529f7a6b..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/storage-containers b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/storage-containers deleted file mode 100644 index 5bb25bb8..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/storage-locations b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/storage-locations deleted file mode 100644 index 291fa405..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/user_sessions b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/user_sessions deleted file mode 100644 index 29444569..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-interactive-mode/vertica_users b/elpa/vertica-snippets-20181016.748/snippets/sql-interactive-mode/vertica_users deleted file mode 100644 index 73414e02..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181016.748/snippets/sql-mode/.yas-parents b/elpa/vertica-snippets-20181016.748/snippets/sql-mode/.yas-parents deleted file mode 100644 index a20f5c60..00000000 --- a/elpa/vertica-snippets-20181016.748/snippets/sql-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -sql-interactive-mode diff --git a/elpa/vertica-snippets-20181016.748/vertica-snippets-autoloads.el b/elpa/vertica-snippets-20181016.748/vertica-snippets-autoloads.el deleted file mode 100644 index 756a1bef..00000000 --- a/elpa/vertica-snippets-20181016.748/vertica-snippets-autoloads.el +++ /dev/null @@ -1,34 +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" (0 -;;;;;; 0 0 0)) -;;; 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)) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "vertica-snippets" '("vertica-snippets-dir"))) - -;;;*** - -;;;### (autoloads nil nil ("vertica-snippets-pkg.el") (0 0 0 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; vertica-snippets-autoloads.el ends here diff --git a/elpa/vertica-snippets-20181016.748/vertica-snippets-pkg.el b/elpa/vertica-snippets-20181016.748/vertica-snippets-pkg.el deleted file mode 100644 index c7b48b09..00000000 --- a/elpa/vertica-snippets-20181016.748/vertica-snippets-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "vertica-snippets" "20181016.748" "Yasnippets for Vertica" - '((yasnippet "0.6.1")) - :keywords - '("convenience" "snippets") - :authors - '(("Andreas Gerler" . "baron@bundesbrandschatzamt.de")) - :maintainer - '("Andreas Gerler" . "baron@bundesbrandschatzamt.de") - :url "https://github.com/baron42bba/vertica-snippets") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/vertica-snippets-20181016.748/vertica-snippets.el b/elpa/vertica-snippets-20181016.748/vertica-snippets.el deleted file mode 100644 index 3826da3a..00000000 --- a/elpa/vertica-snippets-20181016.748/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-20181211.1035/snippets/sql-interactive-mode/check_rle_overridden b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/check_rle_overridden new file mode 100644 index 00000000..962da6a9 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/current_epoch b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/current_epoch new file mode 100644 index 00000000..cd4550fb --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/errors b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/errors new file mode 100644 index 00000000..f5629f08 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/external_table_details b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/external_table_details new file mode 100644 index 00000000..46846601 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/external_table_details @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: external_table_details +# key: etd_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT table_name, source_format, total_file_size_bytes FROM external_table_details;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/get-partitions b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/get-partitions new file mode 100644 index 00000000..dadd295e --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/get-projections b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/get-projections new file mode 100644 index 00000000..c4457800 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/grants b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/grants new file mode 100644 index 00000000..96d0003b --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/last-statement-timing b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/last-statement-timing new file mode 100644 index 00000000..c598f2ef --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/last-statement-timing @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: last-statement-timing +# key: lst_ +# group: vertica +# -- +SELECT last_statement, + last_statement_duration_us / 1000000.0 last_statement_duration_seconds +FROM current_session; \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-backups b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-backups new file mode 100644 index 00000000..4798d737 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-backups @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: list-backups +# key: ls_backups +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM v_monitor.database_backups ORDER BY 1 DESC;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-tables-row-count-size b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-tables-row-count-size new file mode 100644 index 00000000..6cc9169c --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/list-tables-row-count-size @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# name: list-tables-row-count-size +# key: ls-tables +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT tbl.table_schema AS "Schema Name", + tbl.table_name AS "Table Name", + to_char(sum(prs.ros_row_count)/count(DISTINCT prs.projection_name), '999G999G999G999') AS "No Of Rows", + to_char(sum(prs.ros_used_bytes)/count(DISTINCT prs.projection_name), '999G999G999G999G999') AS "Size In Bytes" +FROM TABLES tbl +JOIN projections prj ON tbl.table_id = prj.anchor_table_id +JOIN projection_storage prs ON prj.projection_name = prs.projection_name +GROUP BY 1, 2 +ORDER BY 1, 2;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/nodes b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/nodes new file mode 100644 index 00000000..7ef2cc9c --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/pool_queues b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/pool_queues new file mode 100644 index 00000000..2c07685d --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/pool_queues @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: pool_queues +# key: pq_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# https://www.vertica.com/blog/calculate-request-queue-length-quick-tip/?utm_campaign=00164962 +# https://www.vertica.com/docs/latest/HTML/index.htm#Authoring/SQLReferenceManual/SystemTables/MONITOR/RESOURCE_ACQUISITIONS.htm +# -- +SELECT node_name, request_type, transaction_id, statement_id, pool_name, (acquisition_timestamp - queue_entry_timestamp) request_queue_length FROM v_monitor.resource_acquisitions WHERE pool_name = '${1:general}' ${2:AND (acquisition_timestamp - queue_entry_timestamp) > '1 second'} ORDER BY (acquisition_timestamp - queue_entry_timestamp) DESC ${3:LIMIT 42};$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/query-times b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/query-times new file mode 100644 index 00000000..be328687 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/rebalance_status b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/rebalance_status new file mode 100644 index 00000000..9c014ca2 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/resource-pool-move b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/resource-pool-move new file mode 100644 index 00000000..5486fe9c --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/resource_pools b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/resource_pools new file mode 100644 index 00000000..2138f59a --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/resource_pools @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: resource_pools +# key: pools_ +# group: vertica +# condition: (if (string-equal sql-product 'vertica)t) +# -- +SELECT * FROM resource_pools;$0 \ No newline at end of file diff --git a/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/resources b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/resources new file mode 100644 index 00000000..16474d2d --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/sessions b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/sessions new file mode 100644 index 00000000..529f7a6b --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/storage-containers b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/storage-containers new file mode 100644 index 00000000..5bb25bb8 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/storage-locations b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/storage-locations new file mode 100644 index 00000000..291fa405 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/user_sessions b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/user_sessions new file mode 100644 index 00000000..29444569 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-interactive-mode/vertica_users b/elpa/vertica-snippets-20181211.1035/snippets/sql-interactive-mode/vertica_users new file mode 100644 index 00000000..73414e02 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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-20181211.1035/snippets/sql-mode/.yas-parents b/elpa/vertica-snippets-20181211.1035/snippets/sql-mode/.yas-parents new file mode 100644 index 00000000..a20f5c60 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/snippets/sql-mode/.yas-parents @@ -0,0 +1 @@ +sql-interactive-mode diff --git a/elpa/vertica-snippets-20181211.1035/vertica-snippets-autoloads.el b/elpa/vertica-snippets-20181211.1035/vertica-snippets-autoloads.el new file mode 100644 index 00000000..756a1bef --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/vertica-snippets-autoloads.el @@ -0,0 +1,34 @@ +;;; 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" (0 +;;;;;; 0 0 0)) +;;; 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)) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "vertica-snippets" '("vertica-snippets-dir"))) + +;;;*** + +;;;### (autoloads nil nil ("vertica-snippets-pkg.el") (0 0 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; vertica-snippets-autoloads.el ends here diff --git a/elpa/vertica-snippets-20181211.1035/vertica-snippets-pkg.el b/elpa/vertica-snippets-20181211.1035/vertica-snippets-pkg.el new file mode 100644 index 00000000..d8ba55e4 --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/vertica-snippets-pkg.el @@ -0,0 +1,12 @@ +(define-package "vertica-snippets" "20181211.1035" "Yasnippets for Vertica" + '((yasnippet "0.6.1")) + :keywords + '("convenience" "snippets") + :authors + '(("Andreas Gerler" . "baron@bundesbrandschatzamt.de")) + :maintainer + '("Andreas Gerler" . "baron@bundesbrandschatzamt.de") + :url "https://github.com/baron42bba/vertica-snippets") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/vertica-snippets-20181211.1035/vertica-snippets.el b/elpa/vertica-snippets-20181211.1035/vertica-snippets.el new file mode 100644 index 00000000..3826da3a --- /dev/null +++ b/elpa/vertica-snippets-20181211.1035/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