Apache Presto - Range Operator


Advertisements

Between operator is used to test the particular value, which exists from minimum to maximum range.

Query 1

presto:default> select 30.5 between 10 and 40 as range; 

Result

 range 
------- 
 true 
(1 row) 

Query 2

presto:default> select 4.5 is null; 

Result

 _col0 
------- 
 false 
(1 row) 

Here, 4.5 is a value and not null since it is checked with null, so the result is false.

Query 3

presto:default> select 3 is not null;

Result

 _col0 
------- 
 true 
(1 row) 

Greatest(x,y)

If the value of x is greater than y, then it returns x, otherwise y.

Query

presto:default> select greatest(200,300) as greatest; 

Result

 greatest 
---------- 
  300 
(1 row) 

The output is returned as the greatest of two values.

Least(x,y)

Returns the least value from the two given values.

Query

presto:default> select least('a','b') as result; 

Result

 result 
-------- 
   a

Here, the lowest character value is ‘a’ hence it is returned in the result.

apache_presto_basic_sql_operations.htm

Useful Video Courses


Video

Apache Spark Online Training

46 Lectures 3.5 hours

Arnab Chakraborty

Video

Apache Spark with Scala - Hands On with Big Data

23 Lectures 1.5 hours

Mukund Kumar Mishra

Video

Learn Apache Cordova using Visual Studio 2015 & Command line

16 Lectures 1 hours

Nilay Mehta

Video

Delta Lake with Apache Spark using Scala

52 Lectures 1.5 hours

Bigdata Engineer

Video

Apache Zeppelin - Big Data Visualization Tool

14 Lectures 1 hours

Bigdata Engineer

Video

Olympic Games Analytics Project in Apache Spark for Beginner

23 Lectures 1 hours

Bigdata Engineer

Advertisements