为了能到远方,脚下的每一步都不能少.|

Dancing-Pierre

园龄:1年10个月粉丝:3关注:0

Hive 标识符列表及保留方法

Hive 标识符列表及保留方法

1、标识符列表

Hive 有一些保留的关键字,我们在执行一些语句时,不能将这些关键字作为标识符(Identifier),比如建表语句的 表名 或者 字段名,以下我们具体看看什么是 Hive 中的 标识符

官方标识符列表:入口
在这里插入图片描述

2、保留标识符方法

如果你非要使用“保留的关键字”作为标识符,官网也给出了建议
在这里插入图片描述

原文如下:

Reserved keywords are permitted as identifiers if you quote them as described in Supporting Quoted Identifiers in Column Names (version 0.13.0 and later, see HIVE-6013). Most of the keywords are reserved through HIVE-6617 in order to reduce the ambiguity in grammar (version 1.2.0 and later). There are two ways if the user still would like to use those reserved keywords as identifiers: (1) use quoted identifiers, (2) set hive.support.sql11.reserved.keywords=false. (version 2.1.0 and earlier)

总结后就是如下两点:

  • 对标识符使用倒引号(backtick);
  • set hive.support.sql11.reserved.keywords=false

本文作者:Dancing-Pierre

本文链接:https://www.cnblogs.com/wyc-1009/p/17548038.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Dancing-Pierre  阅读(32)  评论(0编辑  收藏  举报  
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起