蜂巢中=和==之间有什么区别

Sum*_*osh 1 hive operators

我不小心使用==而不是=在我的一个HQL查询中,但令人震惊的是它没有抛出任何错误,但它正在工作,因为它应该一直在努力=.我的问题是为什么我们==在HQL中有运算符,两者之间的确切区别是什么.

Dav*_*itz 5

===运营商具有相同的功能.
它们由完全相同的类实现.

system.registerGenericUDF("=", GenericUDFOPEqual.class);
system.registerGenericUDF("==", GenericUDFOPEqual.class);
Run Code Online (Sandbox Code Playgroud)

FunctionRegistry.java


+----------+---------------------+----------------------------------------------------------------+
| Operator |    Operand types    |                          Description                           |
+----------+---------------------+----------------------------------------------------------------+
| A = B    | All primitive types | TRUE if expression A is equal to expression B otherwise FALSE. |
| A == B   | All primitive types | Synonym for the = operator.                                    |
+----------+---------------------+----------------------------------------------------------------+
Run Code Online (Sandbox Code Playgroud)

语言手册UDF