Cannot build plan for query - Unknown Exception

Hi Mates,

I am a newbie to Druid and trying to execute a SQL query on Druid using Python (I tried to execute the same from Druid’s Imply SQL interface).

Below is my code from python along with the query that I am trying to execute.

Please help me with how to overcome this error.

Code:

import json

import requests

import math

path=‘http://xxxxxxxxxxxxyyyyyyyyyyyyyyyyy:8082/druid/v2/sql

data_7_q1={‘query’: "select ‘7_day’ as date_considered,max(x) as max_x from druidtable where state=8 and __time >= CURRENT_TIMESTAMP - INTERVAL ‘7’ DAY and country in (3,9,27,39,41,53,65,107,111,113,115,133,139,143,145,159,163,165,187,193,195,205,209,233,243,245,247,251,263,279,281,299,319,341,343,351,353,369,377,385,387,397,405,409,411,445,449,482,485,486,487,492) "}

def query1():

response = requests.post(path, json=data_7_q1)

json=response.json()

print(json)

return json

result_1=query1()

``

The error I am getting is below:

Error:

{u’errorClass’: u’io.druid.java.util.common.ISE’, u’host’: None, u’errorMessage’: u"Cannot build plan for query: select ‘7_day’ as date_considered,max(x) as max_x from druidtable where state=8 and __time >= CURRENT_TIMESTAMP - INTERVAL ‘7’ DAY and country in (3,9,27,39,41,53,65,107,111,113,115,133,139,143,145,159,163,165,187,193,195,205,209,233,243,245,247,251,263,279,281,299,319,341,343,351,353,369,377,385,387,397,405,409,411,445,449,482,485,486,487,492) ", u’error’: u’Unknown exception’}

``

Just repeating myself, I have tried to execute the same from Imply SQL, but returning the same error there as well.

Best Regards,

iPrithvi

I have the same mistake. Have you solved it?

在 2017年7月14日星期五 UTC+8下午12:31:33,iPrithvi写道:

Hey Lin,

Please send me the query you are trying to execute. We have fixed this issue by updating the Druid version to the latest.

Best Regards,

Prithvi.

Hey Prithvi.

Thanks.

This is my query:

{
“query”:" select material_id,sum(new_device) as new_device,(100.0sum(click))/sum(impressions) as ctr,(100.0sum(installs))/sum(click) as cr from ad_material where __time > TIMESTAMP ‘2018-07-31 00:00:00’ and __time < TIMESTAMP ‘2018-08-19 23:59:59’ and lang in (‘ar’, ‘de’, ‘en’, ‘es’, ‘fr’, ‘id’, ‘it’, ‘ja’, ‘ko’, ‘nl’, ‘pl’,‘ar’, ‘de’, ‘en’, ‘es’, ‘fr’, ‘id’, ‘it’, ‘ja’, ‘ko’) group by material_id"

}

``

What version of your Druid?

Best Regards,

Lin.

在 2018年8月22日星期三 UTC+8下午4:03:38,iPrithvi写道:

Hi Lin,

The query looks ok to me.

Try upgrading to the latest. I am currently using the Druid 0.12.1 version.

Best Regards,

Prithvi.

Hey Prithvi.

Thanks.

I am currently using the Druid 0.11.1 version. I will try upgrading to the latest.

Best Regards.

在 2018年8月23日星期四 UTC+8上午9:59:08,iPrithvi写道: