When I try to sql query a druid datasource, this error is thrown:
query:
select * from table
error:
Unrecognized token ‘select’: was expecting (‘true’, ‘false’ or ‘null’) at [Source: (StringReader); line: 1, column: 7]
Is it even possible to sql query a druid datasource via metabase?
I can do that via Druid console though.
By the way I have a table containing a list of sales. Each sale has a category and a selling price. I need to get the avarage price of each category. In sql I’d do something like:
I don’t have Druid, but you should be able to use SQL, just like with any other console.
I don’t know why it’s failing that plain query, but it looks like the error is returned from the database, not Metabase.
Can you make a question using the interface, like Simple question? Or do you have the same errors with all types of questions?
My fault: the table I was trying to simple query had all string fields so I could only count rows and I couldn’t find sum or avg options. I’ve changed types and it works good now.
SQL query still throwing error as above. I’m on version 0.33.3
Why do you think the error is returned from the db and not from metabase? (I’m kinda new to metabase)
@enlo
So the table you’re trying to use in SQL, which fails, what happens if you use Simple question to view the table? If that works, then click the Editor-icon top-right and convert to SQL by clicking top-right “View the SQL”. Then compare that to your failing query.
I think the error comes from something not-Metabase, since there’s no error string like that. But it could also come from the driver.
Yes I have druid.sql.query=true in common.runtime.properties file. In fact I can use sql within druid console.
Anyway I don’t think I need to use sql anymore since I solved the mistake I was doing with simple query.
Was anyone able to resolve this issue ?
I can run simple select like “select * from…” in Druid console but not able to run the same in metabase.
Is there any configuration that needs to be enabled for the same?