Hey Team, Do we have any info on Segment Metadata...
# troubleshooting
a
Hey Team, Do we have any info on Segment Metadata like how Druid provides : https://druid.apache.org/docs/latest/querying/segmentmetadataquery.html Looking to derive few info like cardinality of column etc
k
You should be able to see all segments and their metadata from the
Tables
tab in the UI.
l
@Anish Nair there is no direct support for data dictionary queries in Pinot afaik. However, you should be able to derive most of the information per table. There is a virtual column
$segmentName
You can use this to get segment level insights of a table. https://docs.pinot.apache.org/basics/components/schema#built-in-virtual-columns simple example:
Copy code
select $segmentName, count(*) from <table>
where 
<time_column> >= 'start-time' AND <time_column> < 'end-time'
group by $segmentName
However, unlike data dictionary you can't get insights across tables in pinot.
a
Looking to get cardinality of columns in a Segment of a Particular Table. i guess its not available via API
k
You can by running a simple group by query on $segmentName.
e,g,
SELECT DISTINCT(colName), $segmentName FROM table GROUP BY $segmentName
a
might be heavy ?
k
The count, min, max atleast use just the metadata information so shouldn't be heavy. Distinct might not be heavy as well if you have a dictionary on the column.
a
okay. will give a try.