https://pinot.apache.org/ logo
n

Nick Bowles

02/24/2021, 12:08 AM
Trying to run a fairly simply query, borrowing from the docs, and anytime I try to do any sort of grouping on the date field I get an error. Grouping for others works. Thanks in advance!
Copy code
SELECT COUNT(*)
FROM mytable
GROUP BY DATETIMECONVERT(item_date, '1:DAYS:SIMPLE_DATE_FORMAT:yyyy-MM-dd', '1:WEEKS:EPOCH', '1:WEEKS')
error
Copy code
"errorCode": 200,
    "message": "QueryExecutionError:\norg.apache.pinot.core.query.exception.BadQueryRequestException: Caught exception while initializing transform function: datetimeconvert\n\tat org.apache.pinot.core.operator.transform.function.TransformFunctionFactory.get(TransformFunctionFactory.java:207)\n\tat
table date config
Copy code
"dateTimeFieldSpecs": [
    {
      "name": "item_date",
      "dataType": "STRING",
      "format": "1:DAYS:SIMPLE_DATE_FORMAT:yyyy-MM-dd",
      "granularity": "1:DAYS"
    }
  ]
x

Xiang Fu

02/24/2021, 12:08 AM
Copy code
DATETIMECONVERT
doesn’t support week,
use dateTrunc
n

Nick Bowles

02/24/2021, 12:09 AM
That’s got a week example? will make a note to update that
x

Xiang Fu

02/24/2021, 12:09 AM
I think it’s wrong 😞
n

Nick Bowles

02/24/2021, 12:10 AM
thanks for the quick response!
x

Xiang Fu

02/24/2021, 12:10 AM
I will fix the doc
n

Nick Bowles

02/24/2021, 12:10 AM
I can do that, going to go through and do a couple of things
x

Xiang Fu

02/24/2021, 12:10 AM
sure
thanks!
n

Nick Bowles

02/24/2021, 12:10 AM
np thanks for your help