Skip to content

Conversation

@Adnanmuhamed
Copy link

This implementation adds support for parsing and handling byte sizes and time durations in the Wrangler library. The changes include:

  1. New Classes:

    • ByteSize.java: Implements parsing and conversion of byte sizes (KB, MB, GB, TB, PB)
    • TimeDuration.java: Implements parsing and conversion of time durations (ns, ms, s)
    • AggregateStats.java: New directive for aggregating statistics based on size and time columns
    • AggregateStatsTest.java: Comprehensive test coverage for all new functionality
  2. Modified Files:

    • TokenType.java: Added BYTE_SIZE and TIME_DURATION types
    • Directives.g4: Added grammar rules for byte size and time duration parsing

Key Features:

  • Robust parsing of byte sizes and time durations with proper error handling
  • Support for unit conversion between different formats
  • Comprehensive test coverage including edge cases
  • Follows Java 8 standards and project conventions
  • Proper error handling for invalid formats

The implementation allows users to:

  • Parse and convert between different byte size units (KB, MB, GB, TB, PB)
  • Parse and convert between different time duration units (ns, ms, s)
  • Aggregate statistics based on size and time columns using the new AggregateStats directive

…support for parsing and handling byte sizes and time durations, along with a new AggregateStats directive. The changes include new classes for byte size and time duration parsing, modifications to the grammar and token types, and comprehensive test coverage. The implementation follows Java 8 standards and project conventions, providing robust error handling and unit conversion capabilities. Description: Implementation of Byte Size and Time Duration Parsing with AggregateStats Directive Changes Made: 1. Added support for parsing byte sizes (KB, MB, GB, TB, PB) and time durations (ns, ms, s) 2. Created new classes: - ByteSize.java: Handles byte size parsing and conversion - TimeDuration.java: Handles time duration parsing and conversion - AggregateStats.java: Implements the aggregation directive - AggregateStatsTest.java: Comprehensive test coverage 3. Modified existing files: - TokenType.java: Added BYTE_SIZE and TIME_DURATION types - Directives.g4: Added grammar rules for byte size and time duration parsing Key Features: - Robust parsing of byte sizes and time durations - Proper error handling for invalid formats - Unit conversion support - Comprehensive test coverage - Follows Java 8 standards and project conventions The implementation allows users to: - Parse and convert between different byte size units - Parse and convert between different time duration units - Aggregate statistics based on size and time columns

Implementation of Byte Size and Time Duration Parsing with AggregateStats Directive

Changes Made:
1. Added support for parsing byte sizes (KB, MB, GB, TB, PB) and time durations (ns, ms, s)
2. Created new classes:
   - ByteSize.java: Handles byte size parsing and conversion
   - TimeDuration.java: Handles time duration parsing and conversion
   - AggregateStats.java: Implements the aggregation directive
   - AggregateStatsTest.java: Comprehensive test coverage

3. Modified existing files:
   - TokenType.java: Added BYTE_SIZE and TIME_DURATION types
   - Directives.g4: Added grammar rules for byte size and time duration parsing

Key Features:
- Robust parsing of byte sizes and time durations
- Proper error handling for invalid formats
- Unit conversion support
- Comprehensive test coverage
- Follows Java 8 standards and project conventio
@google-cla
Copy link

google-cla bot commented Apr 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Added proper JavaDoc documentation for:
- BYTE_SIZE enum value with examples of byte size units
- TIME_DURATION enum value with examples of time duration units
 Added comprehensive test coverage:
   - ByteSizeTest.java: Tests for byte size parsing and conversion
   - TimeDurationTest.java: Tests for time duration parsing and conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant