sriramdas sivasai
07/14/2021, 8:03 PMselect SUM(total_run_time) from events where user_id = 'XXXXX' GROUP BY TIMECONVERT(time,'SECONDS','HOURS')
here is my table config
{
"OFFLINE": {
"tableName": "events_OFFLINE",
"tableType": "OFFLINE",
"segmentsConfig": {
"timeType": "SECONDS",
"timeColumnName": "time",
"replication": "1"
},
"tenants": {
"broker": "DefaultTenant",
"server": "DefaultTenant"
},
"tableIndexConfig": {
"autoGeneratedInvertedIndex": false,
"createInvertedIndexDuringSegmentGeneration": false,
"loadMode": "MMAP",
"enableDefaultStarTree": true,
"enableDynamicStarTreeCreation": false,
"aggregateMetrics": true,
"nullHandlingEnabled": false
},
"metadata": {},
"ingestionConfig": {
"batchIngestionConfig": {
"segmentIngestionType": "APPEND",
"segmentIngestionFrequency": "DAILY"
}
},
"isDimTable": false
}
}
i'm actually trying out with less number of records of 0.5million and its has 1 metrics and 1 time stamp and 5 dimensions. please let me know, is there any change that needs to be done in the table config to make the queries run faster. ThanksJackie
07/14/2021, 9:00 PMJackie
07/14/2021, 9:05 PMtime
is a preserved key in SQL, so you need to put it into double quotes:
select SUM(total_run_time) from events where user_id = 'XXXXX' GROUP BY TIMECONVERT("time",'SECONDS','HOURS')
sriramdas sivasai
07/14/2021, 10:07 PMtime
in single quotes and it throws me an exception.sriramdas sivasai
07/14/2021, 10:07 PMMayank
Jackie
07/14/2021, 10:26 PMJackie
07/14/2021, 10:26 PMMayank