Skip to content

Conversation

@cpwright
Copy link
Owner

No description provided.

@cpwright cpwright requested a review from Copilot December 10, 2025 19:43
@github-actions
Copy link

Pull Request titles must follow the Conventional Commits specification.
Breaking changes that are expected to impact users must include "BREAKING CHANGE: " at the end of the PR description.

Details:

No release type found in pull request title "reaggregate support for groupBy.". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

No docs changes detected for 2ca4ae4

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds reaggregation support for groupBy operations in rollup tables, enabling hierarchical grouping operations to work correctly when aggregating already-aggregated data.

Key Changes:

  • Introduces GroupByReaggreagateOperator for handling re-aggregation of grouped data in rollup operations
  • Adds getAggregatedSource() method to the AggregateColumnSource interface to expose underlying aggregated sources
  • Adds comprehensive test coverage for both static and incremental rollup group operations

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
GroupByReaggreagateOperator.java New operator implementing reaggregation logic for groupBy operations on already-aggregated data
AggregateColumnSource.java Adds new interface method to expose the underlying aggregated column source
BaseAggregateColumnSource.java Implements the new getAggregatedSource() interface method
BaseAggregateSlicedColumnSource.java Implements the new getAggregatedSource() interface method
RangeAggregateColumnSource.java Implements the new getAggregatedSource() interface method
AggregationProcessor.java Integrates GroupByReaggreagateOperator into rollup aggregation processing
TestRollupTable.java Adds test coverage for static and incremental rollup group operations
RollupTableImpl.java Adds import (appears unused)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NotNull final LongChunk<? extends RowKeys> postShiftRowKeys,
final long destination) {
// we don't need to deal with these yet
throw new IllegalStateException();
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message thrown by shiftChunk should be more descriptive. It should match the message from the BucketedContext version on line 159 to maintain consistency and provide clearer information to developers.

Suggested change
throw new IllegalStateException();
throw new IllegalStateException("GroupByReaggregateOperator does not support shiftChunk; this operator does not support shifting.");

Copilot uses AI. Check for mistakes.
cpwright and others added 3 commits December 10, 2025 15:25
…roupByReaggregateOperator.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ces/aggregate/AggregateColumnSource.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

throw new IllegalArgumentException("AggFormula does not support virtual row variables");
}
}

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method initializeVectorColumns is missing a JavaDoc comment explaining its purpose, parameters, and behavior. This is a non-trivial method that should be documented.

Suggested change
/**
* Initializes the {@code vectorColumnDefinitions} map if it has not already been initialized.
* <p>
* For each column in the provided {@code definition}, if the column is a group-by column (its name is in
* {@code groupByColumnSet}), its original {@link ColumnDefinition} is used. Otherwise, a new
* {@link ColumnDefinition} is created with a vector type corresponding to the column's data type.
* <p>
* After processing all columns from the definition, any additional columns from {@code extraColumns} are added.
*
* @param groupByColumnSet the set of column names used for grouping; these columns retain their original definitions
* @param definition the {@link TableDefinition} containing all columns to process
* @param extraColumns a map of additional column definitions to add to the vector column definitions
*/

Copilot uses AI. Check for mistakes.
Comment on lines +1378 to +1379
// final GroupByChunkedOperator groupByChunkedOperator = makeGroupByOperatorForFormula(inputNonKeyColumns,
// table);
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a commented-out code block (lines 1378-1379) that should either be removed or replaced with a more specific TODO comment explaining why it's commented out and when it should be uncommented.

Suggested change
// final GroupByChunkedOperator groupByChunkedOperator = makeGroupByOperatorForFormula(inputNonKeyColumns,
// table);
// The following code should be restored or implemented when issue #6363 is addressed:
// final GroupByChunkedOperator groupByChunkedOperator = makeGroupByOperatorForFormula(inputNonKeyColumns, table);

Copilot uses AI. Check for mistakes.
vectorColumnDefinitions.putAll(extraColumns);
}


Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra blank line that should be removed to maintain consistent code formatting.

Suggested change

Copilot uses AI. Check for mistakes.
* already filled
* @param aggregations The aggregations
* @param groupByColumns The group-by columns
* @param source
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @param source JavaDoc is missing a description. Please add a description explaining what the source parameter represents (e.g., "the source table used for reaggregation").

Suggested change
* @param source
* @param source The source table used for reaggregation.

Copilot uses AI. Check for mistakes.

/**
* Given that there have been modified input columns, should we propagate changes?
*
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JavaDoc for the hasModifications method has a trailing space after "Given that there have been modified input columns, should we propagate changes?". This should be removed.

Suggested change
*
*

Copilot uses AI. Check for mistakes.
vectorColumnDefinitions.putAll(extraColumns);
}


Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method makeGroupByOperatorForFormula is missing a JavaDoc comment explaining its purpose, parameters, and return value. This is a non-trivial factory method that should be documented.

Suggested change
/**
* Creates a {@link GroupByChunkedOperator} for use with formula aggregations.
*
* @param inputNonKeyColumns The array of input column names (non-key columns) to be grouped.
* @param table The {@link QueryTable} on which the group by operation will be performed.
* @param exposedRowsets The name of the row set column to be exposed in the result.
* @return A {@link GroupByChunkedOperator} configured for the specified columns and table.
*/

Copilot uses AI. Check for mistakes.
Comment on lines +2290 to +2293

private static class WithSource extends AggregationProcessor {
private final @NotNull Table source;

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WithSource class is missing JavaDoc documentation explaining its purpose and why it's needed. Since it's extending AggregationProcessor with additional state, it should be properly documented.

Suggested change
private static class WithSource extends AggregationProcessor {
private final @NotNull Table source;
/**
* An {@link AggregationProcessor} that additionally retains a reference to the source {@link Table}.
* <p>
* This class is used when it is necessary to associate the aggregation processor with its originating table,
* for example, to provide context or enable operations that require access to the original data.
*
* @see AggregationProcessor
*/
private static class WithSource extends AggregationProcessor {
private final @NotNull Table source;
/**
* Constructs a WithSource instance.
*
* @param aggregations the collection of aggregations to process
* @param type the type of aggregation
* @param source the source table associated with this processor
*/

Copilot uses AI. Check for mistakes.
addBasicOperators((t, n) -> makeVarOrStdOperator(t, n, false, false));
}
}

Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validateSelectColumnForFormula method is missing a JavaDoc comment explaining its purpose and when it should be used. This validation method should be documented to clarify what constraints it enforces.

Suggested change
/**
* Validates that the provided {@link SelectColumn} is suitable for use in an aggregation formula.
* <p>
* This method enforces the following constraints:
* <ul>
* <li>The {@code SelectColumn} must not reference column arrays.</li>
* <li>The {@code SelectColumn} must not use virtual row variables.</li>
* </ul>
* <p>
* This validation should be used when preparing a {@code SelectColumn} for use with {@code AggSpecFormula}
* or similar aggregation operations that do not support these features.
*
* @param selectColumn the {@code SelectColumn} to validate
* @throws IllegalArgumentException if the {@code SelectColumn} uses column arrays or virtual row variables
*/

Copilot uses AI. Check for mistakes.
Comment on lines +319 to +320
/* TODO: FIX THIS. */
return true;
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a TODO comment indicating that the hasModifications method needs to be fixed. This should either be addressed before merging or tracked with a more specific issue reference.

Suggested change
/* TODO: FIX THIS. */
return true;
return columnsModified;

Copilot uses AI. Check for mistakes.
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.

2 participants