Ali
11/18/2021, 11:09 AMRichard Startin
11/18/2021, 11:13 AMAli
11/18/2021, 11:14 AMAli
11/18/2021, 11:16 AMRichard Startin
11/18/2021, 11:16 AMRichard Startin
11/18/2021, 11:18 AMAli
11/18/2021, 11:19 AMAli
11/18/2021, 11:20 AMRichard Startin
11/18/2021, 11:21 AMRichard Startin
11/18/2021, 11:23 AMAli
11/18/2021, 11:23 AMAli
11/18/2021, 11:26 AM{
"tableName": "op_test",
"tableType": "OFFLINE",
"segmentsConfig": {
"segmentPushType": "APPEND",
"segmentAssignmentStrategy": "BalanceNumSegmentAssignmentStrategy",
"replication": "1"
},
"tenants": {},
"tableIndexConfig": {
"enableDefaultStarTree": true,
"loadMode": "MMAP",
"invertedIndexColumns": [
"gender"
]
},
"metadata": {
"customConfigs": {}
}Richard Startin
11/18/2021, 11:26 AMAli
11/18/2021, 11:27 AMRichard Startin
11/18/2021, 11:31 AMDISTINCT_COUNT_THETA_SKETCH(col, 'nominalEntries=8192')
and you can go even higherRichard Startin
11/18/2021, 11:32 AMk https://datasketches.apache.org/docs/Theta/ThetaSketchSetOpsAccuracy.htmlRichard Startin
11/18/2021, 11:32 AMRichard Startin
11/18/2021, 11:33 AMAli
11/18/2021, 11:35 AMRichard Startin
11/18/2021, 11:37 AMAli
11/18/2021, 11:40 AMAli
11/18/2021, 11:40 AMRichard Startin
11/18/2021, 11:41 AMAli
11/18/2021, 11:42 AMAli
11/18/2021, 11:43 AMRichard Startin
11/18/2021, 11:44 AMAli
11/18/2021, 11:45 AMRichard Startin
11/18/2021, 11:45 AMAli
11/18/2021, 11:47 AM9IPX6Q4ZD9TT8QD
K7IL68L885FWT07
HINHAWWUCYUADZBRichard Startin
11/18/2021, 11:49 AMRichard Startin
11/18/2021, 11:50 AMAli
11/18/2021, 11:53 AMRichard Startin
11/18/2021, 11:54 AMRichard Startin
11/18/2021, 11:54 AMAli
11/18/2021, 11:55 AMRichard Startin
11/18/2021, 11:58 AMRichard Startin
11/18/2021, 11:58 AMAli
11/18/2021, 11:59 AM....{
"name": "heid",
"dataType": "STRING"
},...Richard Startin
11/18/2021, 11:59 AM{
"tableName": "op_test",
"tableType": "OFFLINE",
"segmentsConfig": {
"segmentPushType": "APPEND",
"segmentAssignmentStrategy": "BalanceNumSegmentAssignmentStrategy",
"replication": "1"
},
"tenants": {},
"tableIndexConfig": {
"enableDefaultStarTree": true,
"loadMode": "MMAP",
"invertedIndexColumns": [
"gender"
],
"sortedColumn": ["heid"]
},
"metadata": {
"customConfigs": {}
}Ali
11/18/2021, 12:04 PMRichard Startin
11/18/2021, 12:06 PMheidRichard Startin
11/18/2021, 12:06 PMheid sorting on it will really help, it's generally good to sort on high cardinality attributesAli
11/18/2021, 12:07 PMRichard Startin
11/18/2021, 12:08 PMjcmd <server pid> JFR.start duration=60s filename=distinctcount.jfr and send it to me and I'll take a look to be sure what I think is happening is happening, but do that before reingestingRichard Startin
11/18/2021, 12:08 PMAli
11/18/2021, 12:11 PMAli
11/18/2021, 12:13 PMsegmentCreationJobParallelism: 14 from 1, some of the segments/data is missing when the ingest is completed. I couldn't find anything in github issues about it...nor any errors in the logs. Any ideas what could be going wrong?Richard Startin
11/18/2021, 12:51 PMRichard Startin
11/18/2021, 12:52 PMKishore G
Kishore G
Ali
11/18/2021, 5:26 PMAli
11/18/2021, 5:28 PMRichard Startin
11/18/2021, 5:35 PMRichard Startin
11/18/2021, 5:36 PMAli
11/18/2021, 7:50 PMKishore G
Jackie
11/18/2021, 8:15 PMdistinctCountHll?Jackie
11/18/2021, 8:16 PMlog2m for distinctCountHll to get better accuracy, e.g. distinctCountHll(col_a, 15)Jackie
11/18/2021, 8:17 PMdistinctCountBitmap(col_a) which counts the accurate unique hash values with java String.hashCode()Ali
11/18/2021, 8:48 PMredshift
count: 15476256
time: 525.429 seconds
select distinctCountHll(heid)
timeUsedMs: 18107
count: 14866424
select distinctCountHll(heid, 15)
timeUsedMs: 17140
count: 15375247
select distinctCountHll(heid, 30)
OutOfMemoryError
select distinctCountBitmap(heid)
timeUsedMs: 43089
count: 15448390
the table config for this table is slightly different than previous:
"tableIndexConfig": {
"loadMode": "MMAP",
"invertedIndexColumns": [
"gender",
"heid"
]
},Ali
11/18/2021, 8:52 PMKishore G
Ali
11/18/2021, 9:04 PMJackie
11/18/2021, 10:27 PMJackie
11/18/2021, 10:28 PMJackie
11/18/2021, 10:29 PMselect distinctCountHll(heid, 15) is giving quite close result with low latencyRichard Startin
11/18/2021, 10:43 PMRichard Startin
11/18/2021, 10:43 PMAli
11/23/2021, 10:45 AM"tableIndexConfig": {
"segmentPartitionConfig": {
"columnPartitionMap": {
"hesid": {
"functionName": "Murmur",
"numPartitions": 32
}
}
},
"sortedColumn": [
"hesid"
]
When I do a distinct count by hesid, I’m getting an OutOfMemoryError, the timeout is 120seconds.Richard Startin
11/23/2021, 11:03 AMRichard Startin
11/23/2021, 4:07 PMMayank
Ali
11/23/2021, 8:37 PMselect count(distinct hesid), financial_year
from op_test
group by financial_year
limit 10Mayank
Richard Startin
11/23/2021, 9:51 PMMayank
Ali
11/24/2021, 3:26 PMselect SEGMENTPARTITIONEDDISTINCTCOUNT(hesid), financial_year
from op_test
group by financial_year
limit 10
the query comes back within a few seconds but the numbers are too small e.g. 36159185 instead of the actual 49233971 for a particular financial_yearRichard Startin
11/24/2021, 3:54 PMRichard Startin
11/24/2021, 3:55 PMhesid for it to work properly... exact distinct counts on large data sets are hard...Ali
11/24/2021, 4:14 PM"tableIndexConfig": {
"segmentPartitionConfig": {
"columnPartitionMap": {
"hesid": {
"functionName": "Murmur",
"numPartitions": 32
}
}
},
"sortedColumn": [
"hesid"
]Ali
11/24/2021, 4:15 PMAli
11/24/2021, 4:16 PMRichard Startin
11/24/2021, 4:19 PMhesid is that if you ingest some more data and some `hesid`'s you've seen before show up, they would need to go in to already built segments, otherwise the partitioning would be violated by the new dataRichard Startin
11/24/2021, 4:20 PMKishore G
Kishore G
Kishore G
Ali
11/24/2021, 5:53 PM"tableIndexConfig": {
"segmentPartitionConfig": {
"columnPartitionMap": {
"hesid": {
"functionName": "Murmur",
"numPartitions": 32
}
}
},
"sortedColumn": [
"hesid"
]Jackie
11/24/2021, 7:08 PMJackie
11/24/2021, 7:10 PMRichard Startin
11/24/2021, 7:10 PMRichard Startin
11/24/2021, 7:12 PMRichard Startin
11/24/2021, 7:13 PMhesid, and if he ingests new data with some of the same hesid what does he need to do to ensure the partitioning isn't later violated, assuming he queries over large time rangesMayank
1. The query is performing accurate count distinct on 635M records, which is quite an expensive operation. (Not sure if the thread mentioned what's the resource provided to servers).
2. PartitionedDistinctCount currently only works when partition key is limited to a segment. So either it has to be a REFRESH use case, or a case where keys are scoped within a day (unlikely?).
3. For such cases we recommend distinctCountHLL which provides high accuracy approximation at low latency.Ali
11/25/2021, 10:03 AMAli
11/25/2021, 10:04 AMdistinctCountHLL is fast but not accurate enough, it’s off by 10's of thousands and I need something either exact or to the nearest 5.Mayank
Ali
11/25/2021, 9:13 PMMayank
Ali
11/26/2021, 2:37 PM"tableIndexConfig": {
"segmentPartitionConfig": {
"columnPartitionMap": {
"hesid": {
"functionName": "Murmur",
"numPartitions": 32
}
}
},
"sortedColumn": [
"hesid"
]Ali
11/26/2021, 2:38 PMMayank
Ali
11/26/2021, 9:38 PM