Error in MySQL to HiveQL Conversion including DATE_SUB and INTERVAL
NickName:Prakul Ask DateTime:2020-08-13T20:07:11

Error in MySQL to HiveQL Conversion including DATE_SUB and INTERVAL

I am trying to convert the query written in MySQL to HiveQL The part of query giving me error is :

 WHERE 1 = 1
 AND table1.incoming_date >= DATE_SUB(DATE_SUB(CURDATE(),INTERVAL DAY(CURDATE()) - 1 DAY),INTERVAL 3 MONTH)

Most probably it is because INTERVAL is not supported in Hive with DATE_SUB(). So, can someone convert this part for me.

Error:

ParseException: 
extraneous input 'DAY' expecting {')', ','}(line 179, pos 60)

Copyright Notice:Content Author:「Prakul」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63394826/error-in-mysql-to-hiveql-conversion-including-date-sub-and-interval

More about “Error in MySQL to HiveQL Conversion including DATE_SUB and INTERVAL” related questions

Error in MySQL to HiveQL Conversion including DATE_SUB and INTERVAL

I am trying to convert the query written in MySQL to HiveQL The part of query giving me error is : WHERE 1 = 1 AND table1.incoming_date >= DATE_SUB(DATE_SUB(CURDATE(),INTERVAL DAY(CURDATE()) -...

Show Detail

Mysql DATE_SUB(NOW(), INTERVAL 365 DAY) MYSQL ERROR

SELECT DATE_FORMAT(created_date,'%W') as day, DATE_FORMAT(created_date,'%d') as dat, DATE_FORMAT(created_date,'%M') as mon, created_date as dated, SUM(price) AS amount FROM `order_invoice` BETWEEN

Show Detail

Alternate method to use mysql date_sub(now(),interval 1 day) in php?

Alternate method to use mysql date_sub(now(),interval 1 day) in php? Actually I want this alternative because in zend where clause second parameter is date_sub function and it is taking it as stri...

Show Detail

mysql date_sub using a field as interval

I need help with mysql and date_sub(). I have a table call Activity Activity(id,deadline,alert) Activity(1,'2011-04-18','1 DAY'); Activity(2,'2011-04-13','1 MONTH'); Every row in A have an

Show Detail

MySQL - Search Query between DATE_SUB() AND DATE_SUB() Error

I am trying to do a search query (using pdo php and mysql) between a date range which is between (date-7days) and (date-1day) using DATE_SUB() on both so for example: end_date is 2013-03-26 search

Show Detail

MySql query syntax error DATE_SUB

what's wront with this query? SELECT * FROM containmentTracker WHERE reviewDate < NOW() AND reviewDate > DATE_SUB(NOW(), INTERVAL 10 YEARS) I've tried in several way but every time I use

Show Detail

DATE_SUB syntax error

I am trying to create a cron job to delete records that are more than an hour old and the field 'activated' = 0 but I keep getting a message to check my syntax. $sql = "DELETE * FROM user WHERE

Show Detail

in date_sub function while using a interval can we use an interval of month and day combined?

If I need to select database for the past month is this the correct way? $month1=mysql_query("select * from users where date_sub(concat(curdate(), ' 00:00:00'), interval 1 month day(curdate()) day...

Show Detail

mysql match by date using date_sub

I have this mysql query SELECT * FROM all_sent_Orders a WHERE a.nachforschungCompletedOn IS NULL AND CASE WHEN a.lastMessageSent IS NOT NULL AND a.lastResponse IS NULL THEN date(da...

Show Detail

analog to MySQL's DATE_SUB / INTERVAL

In MySQL the following will tell you what the date was a month ago: SELECT DATE_SUB(NOW(), INTERVAL 1 MONTH); The SQL fiddle. How can this be done in SQL Server?

Show Detail