hadoop 自学指南八之Hive(2)

一、前言

hive UDF

二、Hive 常用的函数

2.1、关系操作符

Operator 

Operand types 

Description 

A = B 

All primitive types 

TRUE if expression A is equal to expression B otherwise FALSE 

A == B 

None! 

Fails because of invalid syntax. SQL uses =, not == 

A <> B 

All primitive types 

NULL if A or B is NULL, TRUE if expression A is NOT equal to expression B otherwise FALSE 

A < B 

All primitive types 

NULL if A or B is NULL, TRUE if expression A is less than expression B otherwise FALSE 

A <= B 

All primitive types 

NULL if A or B is NULL, TRUE if expression A is less than or equal to expression B otherwise FALSE 

A > B 

All primitive types 

NULL if A or B is NULL, TRUE if expression A is greater than expression B otherwise FALSE 

A >= B 

All primitive types 

NULL if A or B is NULL, TRUE if expression A is greater than or equal to expression B otherwise FALSE 

A IS NULL 

all types 

TRUE if expression A evaluates to NULL otherwise FALSE 

A IS NOT NULL 

All types 

TRUE if expression A evaluates to NULL otherwise FALSE 

A LIKE B 

strings 

NULL if A or B is NULL, TRUE if string A matches the SQL simple regular expression B, otherwise FALSE. The comparison is done character by character. The _ character in B matches any character in A(similar to . in posix regular expressions) while the % character in B matches an arbitrary number of characters in A(similar to .* in posix regular expressions) e.g. 'foobar' like 'foo' evaluates to FALSE where as 'foobar' like 'foo_ _ _' evaluates to TRUE and so does 'foobar' like 'foo%' 

A RLIKE B 

strings 

NULL if A or B is NULL, TRUE if string A matches the Java regular expression B(See Java regular expressions syntax), otherwise FALSE e.g. 'foobar' rlike 'foo' evaluates to FALSE where as 'foobar' rlike '^f.*r$' evaluates to TRUE 

A REGEXP B 

strings 

Same as RLIKE 


2.2、代数操作符

Operator 

Operand types 

Description 

A + B 

All number types 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值