ion-cli
ion-cli copied to clipboard
Add subcommand stats to support data stream analysis.
Issue #, if available:
https://github.com/amazon-ion/ion-cli/issues/42 This PR is the updated version of PR#104. Since a lot of refactoring has been done, creating a new PR would be easier to review.
Description of changes:
This PR adds option stats to analyze the input binary Ion data stream, allowing users to:
- Get the maximum depth of the input data stream.
- Get insights into the top-level values, including the minimum, maximum and average size, size distributions, and total number of the top-level values.
- Gain insights into the symbol table, including the ability to request the number of local symbol tables and the number of symbols in the provided Ion stream.
This PR also removes count since stats already includes this information.
Test:
A unit test has been added at the end of stats.rs
Input: ion --unstable stats test.10n
Output:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.