Ask Your Question
0

I have error reading query from JDBC query consumer

asked 2020-05-27 17:08:26 -0500

anonymous user

Anonymous

updated 2020-05-28 08:44:50 -0500

Hi All, i have query which is running fine in hive/hue and i'm using jdbc consumer origin and it's throwing an error. can plz let me know if some had similar issue. Thank you.

Error: SQLState: HY000 Error Code: 500051 Message: [Cloudera][HiveJDBCDriver](500051) ERROR processing query/statement. Error Code: 40000, SQL state: TStatus(statusCode:ERROR_STATUS, infoMessages:[*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: ParseException line 10:12 mismatched input 'as' expecting ) near '0' in from source:28:27,

#

with last_month as ( select max(dt) max_dt from app_raw.details where dt between months_add(now(),-12) and now() ), month_pool as ( select add_months(max_dt,zz.n) as dt from (VALUES(0 as n),(-1),(-2),(-3),(-4),(-5),(-6),(-7),(-8),(-9),(-10),(-11)) zz join last_month on 1=1 ) select market , product_id , FROM_TIMESTAMP(mp.dt,'yyyy-MM-dd') as start_date , FROM_TIMESTAMP(last_day(mp.dt),'yyyy-MM-dd') as end_date from ( select product_id , market , max( nvl(case when v.dt<lm.max_dt then="" dt="" end,="" months_add(lm.max_dt,-12)))="" as="" min_dt="" ,="" lm.max_dt="" as="" max_dt="" ,="" max(case="" when="" v.dt="lm.max_dt" then="" 1="" else="" 0="" end)="" as="" is_current="" from="" app_raw.details="" v="" join="" last_month="" lm="" on="" v.dt="" between="" months_add(max_dt,-12)="" and="" max_dt="" group="" by="" product_id,="" market,="" lm.max_dt="" )="" a="" join="" month_pool="" mp="" on="" mp.dt="" between="" add_months(a.min_dt,1)="" and="" a.max_dt="" where="" is_current="1&lt;/p">

edit retag flag offensive close merge delete

Comments

What does your query look like?

iamontheinet gravatar imageiamontheinet ( 2020-05-27 23:52:31 -0500 )edit

hi @iamontheinet thanks for looking into it. attached query in question.

strem_dev gravatar imagestrem_dev ( 2020-05-28 08:43:20 -0500 )edit

Are you sure that is the whole query configured in StreamSet's origin @strem_dev? Or that this precise blurb is a valid query? I have to say that I don't recall Hive supporting queries that start with "with" keyword.

Jarcec gravatar imageJarcec ( 2020-05-29 16:35:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-29 16:50:05 -0500

strem_dev gravatar image

i'm using jdbc origin and issue i had was hive not supporting time_stamp function(impala does). i have changed my query now its working fine. yes in hive we can use with its wrking fine fr me :)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-05-27 17:08:26 -0500

Seen: 40 times

Last updated: May 28