forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add utility to print summary of a vector (facebookincubator#11859)
Summary: Pull Request resolved: facebookincubator#11859 Introduce VectorPrinter::summarizeToText helper function to generate human-friendly summary of a vector. The summary shows the overall hierarchy of the vector and annotates each node with data type, number of rows, encoding, and size in memory. Dictionary nodes include number of unique indices. Array and Map nodes specify number of empty arrays / maps as well as min/max/avg sizes of the arrays / maps. ``` ROW(4) 8 rows ROW 528B INTEGER 8 rows FLAT 32B ARRAY 8 rows ARRAY 288B Stats: 3 nulls, 1 empty, sizes: [2...4, avg 3] BIGINT 12 rows FLAT 128B MAP 8 rows DICTIONARY 192B Stats: 0 nulls, 4 unique MAP 4 rows MAP 160B Stats: 0 nulls, 1 empty, sizes: [1...4, avg 2] INTEGER 8 rows FLAT 32B REAL 8 rows FLAT 32B VARCHAR 8 rows CONSTANT 16B ``` The summary optionally includes unique node IDs to allow for easy referencing. ``` 0 ROW(4) 8 rows ROW 528B 0.0 INTEGER 8 rows FLAT 32B 0.1 ARRAY 8 rows ARRAY 288B Stats: 3 nulls, 1 empty, sizes: [2...4, avg 3] 0.1.0 BIGINT 12 rows FLAT 128B 0.2 MAP 8 rows DICTIONARY 192B Stats: 0 nulls, 4 unique 0.2.0 MAP 4 rows MAP 160B Stats: 0 nulls, 1 empty, sizes: [1...4, avg 2] 0.2.0.0 INTEGER 8 rows FLAT 32B 0.2.0.1 REAL 8 rows FLAT 32B 0.3 VARCHAR 8 rows CONSTANT 16B ``` The number of RowVector chidren is limited to 5, but can be increased by specifying options.maxChildren: ``` ROW(4) 8 rows ROW 528B INTEGER 8 rows FLAT 32B ARRAY 8 rows ARRAY 288B Stats: 3 nulls, 1 empty, sizes: [2...4, avg 3] BIGINT 12 rows FLAT 128B ...2 more ``` Reviewed By: xiaoxmeng Differential Revision: D67229321 fbshipit-source-id: e52daaf49e82988c6c2a14c4c73fa54f327f6331
- Loading branch information
1 parent
c623766
commit 2d31862
Showing
4 changed files
with
428 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.