云服务器内容精选

  • 描述 调用指定的存储过程。 存储过程由各个连接(connectors)提供,实现数据操作或者管理任务。例如,系统连接器(System Connector)就定义了存储过程可以取消一个正在运行的查询。有些数据源,例如PostgreSQL,其系统有定义自己的存储过程,这与连接器定义的存储过程不同,是无法被CALL调用的。 检查并更新metastore中分区数组,它支持3种模式: ADD:将文件系统中存在但metastore里没有的分区系统同步到metastore中。 DROP:drop元数据表中存在但文件系统中不存在的分区。 FULL:同时进行ADD和DROP操作。
  • 示例 收集表fruit的统计信息: ANALYZE fruit; 统计catalog hive、schema default下的表存储: ANALYZE hive.default.orders; 从hive分区表中统计分区'2020-07-17' , '2020-07-18'信息: ANALYZE hive.web.page_views WITH (partitions = ARRAY[ARRAY['2020-07-17','US'], ARRAY['2020-07-18','US']]);
  • 示例 下面这个例子,你可以看到每个阶段(Stage)的CPU时间消耗,每个计划节点相应的代价。 这个代价是基于现实时间(wall time),而非CPU的相关时间。 对每一个计划节点,都可以看到额外的统计信息,例如每个节点实例的输入平均值,哈希碰撞(hash collisions)的平均次数。这些统计信息对于分析一条SQL语句中的数据异常情况(skewness数据倾斜,abnormal hash collisions)非常有用。 EXPLAIN ANALYZE SELECT count(*),sum(totalprice) FROM new_orders GROUP BY orderstatus; Query Plan ------------------------------------------------------------------------------------------------------------------------------- Fragment 1 [HASH] CPU: 29.19ms, Scheduled: 134.78ms, Input: 2 rows (77B); per task: avg.: 1.00 std.dev.: 1.00, Output: 2 rows (36B) Output layout: [count, sum] Output partitioning: SINGLE [] Stage Execution Strategy: UNGROUPED_EXECUTION Project[] │ Layout: [count:bigint, sum:double] │ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?} │ CPU: 4.00ms (2.34%), Scheduled: 10.00ms (33.33%), Output: 2 rows (36B) │ Input avg.: 0.06 rows, Input std.dev.: 387.30% └─ Aggregate(FINAL)[orderstatus][$hashvalue] │ Layout: [orderstatus:varchar, $hashvalue:bigint, count:bigint, sum:double] │ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?} │ CPU: 6.00ms (3.51%), Scheduled: 17.00ms (56.67%), Output: 2 rows (77B) │ Input avg.: 0.06 rows, Input std.dev.: 387.30% │ count := count("count_9") │ sum := sum("sum_10") └─ LocalExchange[HASH][$hashvalue] ("orderstatus") │ Layout: [orderstatus:varchar, sum_10:double, count_9:bigint, $hashvalue:bigint] │ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?} │ CPU: 2.00ms (1.17%), Scheduled: 3.00ms (10.00%), Output: 2 rows (77B) │ Input avg.: 0.06 rows, Input std.dev.: 556.78% └─ RemoteSource[2] Layout: [orderstatus:varchar, sum_10:double, count_9:bigint, $hashvalue_11:bigint] CPU: 1.00ms (0.58%), Scheduled: 3.00ms (10.00%), Output: 2 rows (77B) Input avg.: 0.06 rows, Input std.dev.: 556.78% Fragment 2 [SOURCE] CPU: 17.35ms, Scheduled: 80.04ms, Input: 4 rows (81B); per task: avg.: 4.00 std.dev.: 0.00, Output: 2 rows (77B) Output layout: [orderstatus, sum_10, count_9, $hashvalue_12] Output partitioning: HASH [orderstatus][$hashvalue_12] Stage Execution Strategy: UNGROUPED_EXECUTION Aggregate(PARTIAL)[orderstatus][$hashvalue_12] │ Layout: [orderstatus:varchar, $hashvalue_12:bigint, sum_10:double, count_9:bigint] │ CPU: 1.00ms (0.58%), Scheduled: 6.00ms (20.00%), Output: 2 rows (77B) │ Input avg.: 4.00 rows, Input std.dev.: 0.00% │ sum_10 := sum("totalprice") │ count_9 := count(*) └─ ScanProject[table = hive:default:new_orders, grouped = false] Layout: [orderstatus:varchar, totalprice:double, $hashvalue_12:bigint] Estimates: {rows: 4 (292B), cpu: 256, memory: 0B, network: 0B}/{rows: 4 (292B), cpu: 548, memory: 0B, network: 0B} CPU: 16.00ms (9.36%), Scheduled: 132.00ms (440.00%), Output: 4 rows (117B) Input avg.: 4.00 rows, Input std.dev.: 0.00% $hashvalue_12 := "combine_hash"(bigint '0', COALESCE("$operator$hash_code"("orderstatus"), 0)) orderstatus := orderstatus:string:1:REGULAR totalprice := totalprice:double:2:REGULAR Input: 4 rows (81B), Filtered: 0.00% (1 row)
  • 示例 describe formatted show_table1 a; Describe Formatted Column ------------------------------ col_name a data_type integer min max num_nulls distinct_count 0 avg_col_len max_col_len num_trues num_falses comment (1 row)
  • 运行示例 以Windows操作系统为例,运行obsutil help mb,查看创建桶命令的帮助文档。 obsutil help mbSummary: create a bucket with the specified parametersSyntax: obsutil mb obs://bucket [-acl=xxx] [-location=xxx] [-fs] [-az=xxx] [-sc=xxx] [-config=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-e=xxx]Options: -fs create a bucket that supports POSIX -az=xxx the AZ of the bucket, possible values are [multi-az] -sc=xxx the default storage class of the bucket, possible values are [standard|warm|cold|deep-archive] -acl=xxx the ACL of the bucket, possible values are [private|public-read|public-read-write] -location=xxx the region where the bucket is located -epid=xxx the enterprise project id of the bucket -kms=xxx the encryption id of the bucket -config=xxx the path to the custom config file when running this command -e=xxx endpoint -i=xxx access key ID -k=xxx security key ID -t=xxx security token摘要: 按照用户指定的桶名和参数创建一个新桶语法: obsutil mb obs://bucket [-fs] [-az=xxx] [-acl=xxx] [-sc=xxx] [-location=xxx] [-config=xxx]选项: -fs 创建支持文件接口(POSIX)的桶 -az=xxx 创桶时可指定的可用区。支持的值:[multi-az] -acl=xxx 创桶时可指定的预定义访问策略。支持的值:[private|public-read|public-read-write] -sc=xxx 创桶时可指定的桶的默认存储类型。支持的值:[standard|warm|cold] -location=xxx 桶所在的区域 -config=xxx 运行当前命令时的自定义配置文件
  • 参数说明 参数 约束 描述 command 可选 查看某个具体命令的帮助文档,当前支持的命令如下: abort,删除分段上传任务 chattri,设置对象属性 cp,上传对象、复制对象、下载对象 ls,列举桶、列举对象、列举分段上传任务 mb,创建桶 mkdir,创建文件夹 mv,移动对象 restore,恢复归档存储对象 rm,删除桶、删除对象 sign,生成对象的下载链接 stat,查询桶属性、查询对象属性 sync,增量同步上传对象、增量同步复制对象、增量同步下载对象 archive,归档日志文件 clear,删除断点记录文件 config,更新配置文件 help,查看命令帮助 version,查看版本号
  • 示例 --PREPARE my_select1 FROM SELECT * FROM fruit;值标识是否为别名 DESCRIBE OUTPUT my_select1;--PREPARE my_select2 FROM SELECT count(*) as my_count, 1+2 FROM fruit; DESCRIBE OUTPUT my_select2;--PREPARE my_create FROM CREATE TABLE foo AS SELECT * FROM fruit; DESCRIBE OUTPUT my_create;
  • 示例 CREATE SCHEMA web; DESCRIBE SCHEMA web; Describe Schema ------------------------------------------------------------------------- web obs://bucket/user/hive/warehouse/web.db dli USER (1 row)