hue的hive编辑器上的语法和快捷键

一、查看快捷键的方式

单击下图中问号:

 

查看快捷键的方式.png

 

快捷键和语法


二、hive的语法

2.1 注释

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

-- Comment

多行注释

/* Multi Line
  Comment */

2.2 点击

  • 双击:双击编辑器左边行数选择所有行。

     

    双击行数选择所有行

  • 拖拽
    从助手拖拽表名到编辑器可以插入相应查询样例到编辑器。

     

    插入相应查询样例到编辑器

  • 右键单击:右键单击hql中的元素可以浏览到元素相应的信息。元素包括函数、列名、表名等。

     

    右键单击

  • 单击:单击左边编辑器的行数选择一整行。

2.3 多语句查询

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

select * from customers;
select * from web_logs;

2.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)}"

三、快捷键

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

3.1 行操作

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插入一行

3.2 选择

Windows/LinuxMacAction描述
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-P---Select to matching bracket 

3.3 多光标

Windows/LinuxMacAction描述
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选择光标所有地方

3.4 跳转

Windows/LinuxMacAction描述
LeftLeft, Ctrl-BGo to left向左跳转
RightRight, Ctrl-FGo to right向右跳转
Ctrl-LeftOption-LeftGo to word left跳转到左边单词
Ctrl-RightOption-RightGo to word right跳转到右边单词
UpUp, Ctrl-PGo line up跳转到上一行
DownDown, Ctrl-NGo line down跳转到下一行
Alt-Left, HomeCommand-Left, Home, Ctrl-AGo to line start跳转到行首
Alt-Right, EndCommand-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-Up---Scroll line up滚动轴向上移动
Ctrl-P---Go to matching bracket 
---Option-PageDownScroll page down滚动轴向下移动一页
---Option-PageUpScroll page up滚动轴向上移动一页

3.5 查找替换

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

3.6 隐藏和展开

Windows/LinuxMacAction描述
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展开所有

3.7 其他

Windows/LinuxMacAction描述
Ctrl-SpaceCtrl-SpaceAutocomplete when Live Autocompletion is off 
Ctrl-i|Ctrl-Shift-fCommand-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-TTranspose letters 
Ctrl-Shift-UCtrl-Shift-UChange to lower case小写
Ctrl-UCtrl-UChange to upper case大写
InsertInsertOverwrite覆盖
Ctrl-Shift-ECommand-Shift-EMacros replay 
Ctrl-Alt-E---Macros recording 
Delete---Delete 
---Ctrl-LCenter selection游标居中

3.8 设置

Windows/LinuxMacAction描述
Ctrl - ,Command - ,Show the settings menu设置

 

  • 3
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值