Apache Presto - Date and Time Operator


Advertisements

Query 1

presto:default> select date '2016-06-20' + interval '2' day as date_add; 

Result

 date_add 
------------ 
 2016-06-22 

The above output indicates two days are added from the specified date using an interval data type.

Query 2

presto:default> select time '12:30' + interval '1' hour as time_add; 

Result

   time_add 
-------------- 
 13:30:00.000 

Here, one hour is added from the given time.

Query 3

presto:default> select timestamp '2016-06-21 12:32' + interval '2' year 
as timestamp_add;

Result

   timestamp_add 
------------------------- 
 2018-06-21 12:32:00.000 
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