Skip to content
Advertisement

Hive TPCDS Query30 “Only SubQuery expressions that are top level conjuncts are allowed “

I am getting the above error when trying to run a tpcds query 30 in Hive. I did research and know this is not allowed in Hive so I am wondering how to rewrite this query. I directly got it from this website. http://www.tpc.org/tpcds/default5.asp

Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 Unsupported SubQuery Expression 'ctr_state': Only SubQuery expressions that are top level conjuncts are allowed

Query 30

Update

Query 30 may have a typo when you generate the query using the tpcds suite. This does not exist in the customer table c_last_review_date_sk and you need to change it to c_last_review_date

Advertisement

Answer

Calculate avg(ctr_total_return) in the subquery customer_total_return using analytic function and remove subquery from the WHERE:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement