Hi guys, I am trying to use `LastWithTime` functio...
# troubleshooting
g
Hi guys, I am trying to use
LastWithTime
function to get the latest data of each group. But unfortunately I got NPE exception. Original intention is to get the top N of a group after group by ad hoc column. Wondering if I have a grammar issue of my PQL:
Copy code
select hostname, lastWithTime('alertId', 'issued', 'STRING')   from uas_nomalized_alert 
where JSON_EXTRACT_SCALAR(attributes, '$.graphQL-businessService', 'STRING', '') = 'Meeting Centers'
group by hostname
alertId
is a 'STRING' column,
issued
is a 'TIMESTAMP' column
Hi, any update?
{ "message": "QueryExecutionError:\nProcessingException(errorCode:450, messageInternalError\njava.lang.NullPointerException\n\tat org.apache.pinot.core.operator.combine.GroupByOrderByCombineOperator.mergeResults(GroupByOrderByCombineOperator.java:236)\n\tat org.apache.pinot.core.operator.combine.BaseCombineOperator.getNextBlock(BaseCombineOperator.java:119)\n\tat org.apache.pinot.core.operator.combine.BaseCombineOperator.getNextBlock(BaseCombineOperator.java:50)", "errorCode": 200 }
n
it’s probably the single quotes around the column names. This works for me
Copy code
select lastwithtime(repo, createdTimeMillis, 'STRING'), createdTimeMillis from pullRequestMergedEvents group by createdTimeMillis limit 10