HUE上hive编辑器快捷键说明

一、引言

Cloudera的Hue组件提供了可视化的开发界面,可以方便进行大数据相关功能的便捷开发。
比如针对Hive开发的hive编辑器,就内置了非常多的快捷操作,善用这些操作,开发时势必会事半功倍。

二、如何查看快捷键

2.1 入口

在这里插入图片描述

2.2 Hive编辑器帮助文档

在这里插入图片描述

三、Hive编辑器的详细用法

3.1 hql注释添加方式

A comment is text that is not executed. It can be of two types:
注释不会被执行。hive编辑器支持两种注释:

单行注释:

-- Comment

多行注释

/* Multi Line
  Comment */

3.2 巧妙使用点击选用需要运行的hql语句块

  • 双击:双击编辑器左边行数选择所有行。
    在这里插入图片描述

  • 单击:单击编辑器左边行数,选择这一行。
    在这里插入图片描述

  • 拖拽表名
    编辑器左侧选择好库、表,拖拽至Hive编辑区,可以插入相应查询样例模板到编辑区。
    插入后,在右侧“助手”tab栏里,可以看到表的schema结构。
    在这里插入图片描述

  • 编辑区右键单击“表名”、“字段名”:可以预览到元素相应的信息。包括字段、表、函数等。
    在这里插入图片描述

3.3 多语句查询支持

在一个编辑器里通过 “;” 来分隔多个查询语句。
执行鼠标位置hql。

select * from web_logs where country_code = "${country_code}";
select * from web_logs where country_code = "${country_code=US}";
select * from web_logs where country_code = "${country_code=CA, FR, US}";
select * from web_logs 
where country_code = "${country_code=CA, FR, US}";

SELECT area,* FROM test.explode_lateral_view LIMIT 100;

3.4 变量

变量是为了在查询中容易配置参数。总共有两种类型变量。

  • 单值变量: ${variable_name}
select * from web_logs where country_code = "${country_code}"
  • 变量可以设置默认值:
select * from web_logs where country_code = "${country_code=US}"
  • 多值变量:${variable_name=variable_value1, variable_value2,...}
select * from web_logs where country_code = "${country_code=CA, FR, US}"

改变展示内容后,展示名字和变量值不一致。

select * from web_logs where country_code = "${country_code=CA(Canada), FR(France), US(United States)}"

四、快捷键

4.0 快捷键说明

快捷键支持windows/linux系列和mac系统。
mac笔记本电脑没有delete、home 、end键。
delete:fn + Backspace
home:fn + left
end: fn + right

4.1 Hive编辑区快捷键

Windows/LinuxMac描述中文描述
Ctrl-DCommand-DRemove line删除行
Alt-Shift-DownCommand-Option-DownCopy lines down向下复制一行
Alt-Shift-UpCommand-Option-UpCopy lines up向上复制一行
Alt-DownOption-DownMove lines down下移行
Alt-UpOption-UpMove lines up上移行
Alt-DeleteCtrl-KRemove to line end删除到行尾
Alt-BackspaceCommand-BackspaceRemove to line start删除到行头
Ctrl-BackspaceOption-Backspace, Ctrl-Option-BackspaceRemove word left向左边删除一个单词
Ctrl-DeleteOption-DeleteRemove word right向右边删除一个单词
Ctrl-OSplit line插入一行

4.2 选择

Windows/LinuxMac描述中文描述
Ctrl-ACommand-ASelect all全选
Shift-LeftShift-LeftSelect left往左边选择
Shift-RightShift-RightSelect right往右边选择
Ctrl-Shift-LeftOption-Shift-LeftSelect word left往左边选择一个单词
Ctrl-Shift-RightOption-Shift-RightSelect word right往右边选择一个单词
Shift-HomeShift-HomeSelect line start选择到行首
Shift-EndShift-EndSelect line end选择到行尾
Alt-Shift-RightCommand-Shift-RightSelect to line end选择到行尾
Alt-Shift-LeftCommand-Shift-LeftSelect to line start选择到行首
Shift-UpShift-UpSelect up向上选择一行
Shift-DownShift-DownSelect down向下选择一行
Shift-PageUpShift-PageUpSelect page up向上选择一页
Shift-PageDownShift-PageDownSelect page down向下选择一页
Ctrl-Shift-HomeCommand-Shift-UpSelect to start选择从当前到开始
Ctrl-Shift-EndCommand-Shift-DownSelect to end选择从当前到结尾
Ctrl-Shift-DCommand-Shift-DDuplicate selection复制
Ctrl-Shift-PSelect to matching bracket

4.3 多光标

Windows/LinuxMac描述中文描述
Ctrl-Alt-UpCtrl-Option-UpAdd multi-cursor above向上增加光标
Ctrl-Alt-DownCtrl-Option-DownAdd multi-cursor below向下增加光标
Ctrl-Alt-RightCtrl-Option-RightAdd next occurrence to multi-selection向下一个发生的地方增加选择
Ctrl-Alt-LeftCtrl-Option-LeftAdd previous occurrence to multi-selection向上一个发生的地方增加选择
Ctrl-Alt-Shift-UpCtrl-Option-Shift-UpMove multicursor from current line to the line above多个光标时将当前的光标向上移动一行
Ctrl-Alt-Shift-DownCtrl-Option-Shift-DownMove multicursor from current line to the line below多个光标时将当前的光标向下移动一行
Ctrl-Alt-Shift-RightCtrl-Option-Shift-RightRemove current occurrence from multi-selection and move to next多个光标时将当前的光标移动到下一个发生的位置
Ctrl-Alt-Shift-LeftCtrl-Option-Shift-LeftRemove current occurrence from multi-selection and move to previous多个光标时将当前的光标移动到上一个发生的位置
Ctrl-Shift-LCtrl-Shift-LSelect all from multi-selection选择光标所有地方

4.4 跳转

Windows/LinuxMac描述中文描述
Left Left,Ctrl-BGo to left向左跳转
Right Right,Ctrl-FGo to right向右跳转
Ctrl-LeftOption-LeftGo to word left跳转到左边单词
Ctrl-RightOption-RightGo to word right跳转到右边单词
Up Up,Ctrl-PGo line up跳转到上一行
Down Down,Ctrl-NGo line down跳转到下一行
Alt-Left, HomeCommand-Left, Home, Ctrl-AGo to line start跳转到行首
Alt-Right,End Command-Right, End, Ctrl-EGo to line end跳转到行尾
PageUpOption-PageUpGo to page up跳转到上一页
PageDownOption-PageDown, Ctrl-VGo to page down跳转到下一页
Ctrl-HomeCommand-Home, Command-UpGo to start跳转到开始
Ctrl-EndCommand-End, Command-DownGo to end跳转到结尾
Ctrl-L, Ctrl-JCommand-L, Command-JGo to line跳转到固定行
Ctrl-DownCommand-DownScroll line down滚动轴向下移动
Ctrl-UpScroll line up滚动轴向上移动
Ctrl-PGo to matching bracket
Option-PageDownScroll page down滚动轴向下移动一页
Option-PageUpScroll page up滚动轴向上移动一页

4.5 查找替换

Windows/LinuxMac描述中文描述
Ctrl-FCommand-FFind查找
Ctrl-HCommand-Option-FReplace替换
Ctrl-KCommand-GFind next查找下一个
Ctrl-Shift-KCommand-Shift-GFind previous查找上一个

4.6 隐藏和展开

Windows/LinuxMac描述中文描述
Alt-L, Ctrl-F1Command-Option-L, Command-F1Fold selection隐藏已经选择的行
Alt-Shift-L, Ctrl-Shift-F1Command-Option-Shift-L, Command-Shift-F1Unfold展开
Alt-0Command-Option-0Fold all隐藏所有
Alt-Shift-0Command-Option-Shift-0Unfold all展开所有

4.7 其他

Windows/LinuxMac描述中文描述
Ctrl-SpaceCtrl-SpaceAutocomplete when Live Autocompletion is off
Ctrl-iCtrl-Shift-f Command-i,Command-Shift-fFormat selection or all格式化
TabTabIndent缩进
Shift-TabShift-TabOutdent删除缩进
Ctrl-ZCommand-ZUndo撤销
Ctrl-Shift-Z, Ctrl-YCommand-Shift-Z, Command-YRedo恢复
Ctrl-/Command-/Toggle comment注释
Ctrl-TCtrl-TTransposeletters
Ctrl-Shift-UCtrl-Shift-UChange to lower case小写
Ctrl-UCtrl-UChange to upper case大写
InsertInsertOverwrite覆盖
Ctrl-Shift-ECommand-Shift-EMacros replay
Ctrl-Alt-EMacros recording
DeleteDelete
Ctrl-LCenter selection游标居中

4.8 设置

Windows/LinuxMac描述中文描述
Ctrl - ,Command - ,Show the settings menu设置
  • 2
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值