Slackbot
04/10/2023, 2:44 AMAdarsh Sanjeev
04/10/2023, 3:16 AMLATEST(expr, maxBytes) form (https://druid.apache.org/docs/latest/querying/sql-functions.html#latest) should resolve this.
LATEST(expr) expects that expr is a numeric value.Abhishek Agarwal
04/10/2023, 3:44 AMJasvir Singh Walia
04/10/2023, 3:46 AMselect
key_score_id ,
key_entity_id ,
key_entity_type ,
key_started ,
latest(evaluation_started, 16) from "int.cp.druid.intelligent_scoring_test_druid_ingestion"
group by key_score_id ,
key_entity_id ,
key_entity_type ,
key_startedJasvir Singh Walia
04/10/2023, 3:49 AM2022.09.0-iap
druid versionAdarsh Sanjeev
04/10/2023, 4:08 AMint.cp.druid.intelligent_scoring_test_druid_ingestion string? Currently, MSQ only supports LATEST (irrespective of form of LATEST) on string columns.(https://druid.apache.org/docs/latest/multi-stage-query/known-issues.html#select)
If the column is not a string, I believe that sql-native engine does support it. The reason it is using sql-msq-task is that reading from an external source (EXTERN) is only used in msq. If you ingest it into druid first, an sql-native task would work.Adarsh Sanjeev
04/10/2023, 4:12 AMJasvir Singh Walia
04/10/2023, 4:34 AMJasvir Singh Walia
04/10/2023, 4:34 AMAdarsh Sanjeev
04/10/2023, 5:33 AMsql-native should support integer values for LATEST(expr). Could you post the full query and stack trace for the exception?Jasvir Singh Walia
04/10/2023, 5:35 AMselect
key_score_id ,
key_entity_id ,
key_entity_type ,
key_started
,
latest(evaluation_started, 32)
from "int.cp.druid.intelligent_scoring_test_druid_ingestion"
group by key_score_id ,
key_entity_id ,
key_entity_type ,
key_started
Full Error-
Error: Unknown exception
java.util.concurrent.ExecutionException: org.apache.druid.java.util.common.UOE: Cannot make VectorValueSelector for column with class[org.apache.druid.segment.column.StringDictionaryEncodedColumn]
java.lang.RuntimeExceptionAdarsh Sanjeev
04/10/2023, 8:12 AMgroup by clause due to the indentation, my mistake.
The above exception is what is thrown from MSQ engine, so that is interesting to see it for a sql-native query.
Could you try setting "vectorize": false in the query context and see if that resolves this?Abhishek Agarwal
04/10/2023, 8:37 AMAdarsh Sanjeev
04/10/2023, 8:42 AMJasvir Singh Walia
04/10/2023, 10:25 AMAdarsh Sanjeev
04/10/2023, 10:42 AMEdit context .Jasvir Singh Walia
04/12/2023, 2:52 AMAdarsh Sanjeev
04/13/2023, 3:49 AM