jetstreamapp / soql-parser-js

Javascript SOQL parser
https://jetstreamapp.github.io/soql-parser-js/
MIT License
79 stars 20 forks source link

Date functions should have isAggregateFn set to true #228

Closed paustint closed 1 year ago

paustint commented 1 year ago

Description

Date functions should have isAggregateFn set to true

As a result, the incorrect results are returned from getFlattenedFields.

SELECT HOUR_IN_DAY(CreatedDate), SUM(Amount)
FROM Opportunity
GROUP BY HOUR_IN_DAY(convertTimezone(CreatedDate))
[
    {
        "name": "CreatedDate",
        "key": "CreatedDate",
        "cellClass": "slds-truncate",
        "resizable": true,
        "sortable": true,
        "width": 200,
        "filters": [
            "TEXT",
            "SET"
        ]
    },
    {
        "name": "expr0",
        "key": "expr0",
        "cellClass": "slds-truncate",
        "resizable": true,
        "sortable": true,
        "width": 200,
        "filters": [
            "TEXT",
            "SET"
        ]
    }
]
image