The newest Spark function Daquan __ function

Source: Internet
Author: User
!

! Expr-Logical non

.


%

Expr1% EXPR2-Returns the remaining portions after EXPR1/EXPR2.

Examples:

> SELECT 2% 1.8;
 0.2
> SELECT MOD (2, 1.8);
 0.2


&

EXPR1 & Expr2-Returns and Expr1 and EXPR2 results.

Examples:

> SELECT 3 & 5;
 1


*

EXPR1 * Expr2-returns EXPR1*EXPR2.

Examples:

> SELECT 2 * 3;
 6


+

Expr1 + expr2-returns expr1+expr2.

Examples:

> SELECT 1 + 2;
 3


-

Expr1-expr2-returns EXPR1-EXPR2.

Examples:

> SELECT 2-1;
 1


/

EXPR1/EXPR2 returns EXPR1/EXPR2. It always performs floating-point points.

Examples:

> SELECT 3/2;
 1.5
> SELECT 2l/2l;
 1.0


<

Expr1 < EXPR2-Returns True if the EXPR1 is less than EXPR2.

Arguments: expr1, EXPR2-The two expressions must be of the same type, or they can be used by a type of ordinary type, and must be a type that can be sorted. For example, a mapping type is not sortable, so it is not supported. For a complex type of array/struct, the data type of the field must be sortable.

Examples:

> SELECT 1 < 2;
 True
> SELECT 1.1 < ' 1 ';
 False
> SELECT to_date (' 2009-07-30 04:17:52 ') < To_date (' 2009-07-30 04:17:52 ');
 False
> SELECT to_date (' 2009-07-30 04:17:52 ') < To_date (' 2009-08-01 04:17:52 ');
 True
> SELECT 1 < NULL;
 Null


<=

EXPR1 <= EXPR2-Returns True if EXPR1 is less than or equal to EXPR2.

Examples:

> SELECT 2 <= 2;
 True
> SELECT 1.0 <= ' 1 ';
 True
> SELECT to_date (' 2009-07-30 04:17:52 ') <= to_date (' 2009-07-30 04:17:52 ');
 True
> SELECT to_date (' 2009-07-30 04:17:52 ') <= to_date (' 2009-08-01 04:17:52 ');
 True
> SELECT 1 <= NULL;
 Null


<=>

EXPR1 <=> EXPR2-Returns the same result as the (=) operator equal to the non-null operand, but returns true if both are null, and False if one of them is null.


Examples:

> SELECT 2 <=> 2;
 True
> SELECT 1 <=> ' 1 ';
 True
> SELECT true <=> NULL;
 False
> SELECT null <=> null;
 True


=

EXPR1 = EXPR2-Returns True if Expr1 equals EXPR2, otherwise it returns false.


Examples:

> SELECT 2 = 2;
 True
> SELECT 1 = ' 1 ';
 True
> SELECT true = NULL;
 Null
> SELECT null = NULL;
 Null


==

Expr1 = = EXPR2-Returns True if Expr1 equals EXPR2, otherwise returns false.


Examples:

> SELECT 2 = 2;
 True
> SELECT 1 = ' 1 ';
 True
> SELECT true = = NULL;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.