@rex0220/kintone-sql-tools 3.83.0 → 3.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cli/ksql.js CHANGED
@@ -23693,8 +23693,9 @@ function validateGroupingRefMembership(ref, resolve3, canonicalItems) {
23693
23693
  }
23694
23694
  function validateGroupingStatic(stmt) {
23695
23695
  const normalized = normalizeGroupingSpec(stmt);
23696
+ const projectedColumns = [...stmt.columns, ...stmt.hiddenWindows ?? []];
23696
23697
  const groupingRefs = [];
23697
- for (const column of stmt.columns) {
23698
+ for (const column of projectedColumns) {
23698
23699
  collectGroupingRefs(column, groupingRefs);
23699
23700
  }
23700
23701
  collectGroupingRefs(stmt.having, groupingRefs);
@@ -23702,7 +23703,7 @@ function validateGroupingStatic(stmt) {
23702
23703
  const forbiddenGroupingRefs = [];
23703
23704
  collectGroupingRefs(stmt.where, forbiddenGroupingRefs);
23704
23705
  collectGroupingRefs(stmt.joins, forbiddenGroupingRefs);
23705
- collectAggregateArgumentGroupingRefs(stmt.columns, forbiddenGroupingRefs);
23706
+ collectAggregateArgumentGroupingRefs(projectedColumns, forbiddenGroupingRefs);
23706
23707
  collectAggregateArgumentGroupingRefs(stmt.having, forbiddenGroupingRefs);
23707
23708
  if (forbiddenGroupingRefs.length > 0) {
23708
23709
  throw new Error(
@@ -23731,7 +23732,7 @@ function validateGroupingPlanning(stmt, resolve3, planningGuardHook = () => void
23731
23732
  validateGroupingStatic(stmt);
23732
23733
  const normalized = normalizeGroupingSpec(stmt);
23733
23734
  const groupingRefs = [];
23734
- for (const column of stmt.columns) {
23735
+ for (const column of [...stmt.columns, ...stmt.hiddenWindows ?? []]) {
23735
23736
  collectGroupingRefs(column, groupingRefs);
23736
23737
  }
23737
23738
  collectGroupingRefs(stmt.having, groupingRefs);
@@ -37734,7 +37735,7 @@ async function buildGroupingFieldResolver(stmt, client, cacheContext, materializ
37734
37735
  async function validateSelectGroupingPlanning(stmt, client, cacheContext, materializedTables) {
37735
37736
  resolvedGroupingSpecs.delete(stmt);
37736
37737
  const normalized = normalizeGroupingSpec(stmt);
37737
- const hasGroupingNodes = JSON.stringify(stmt.columns).includes('"GROUPING_') || JSON.stringify(stmt.orderBy).includes('"GROUPING_');
37738
+ const hasGroupingNodes = JSON.stringify(stmt.columns).includes('"GROUPING_') || JSON.stringify(stmt.hiddenWindows ?? []).includes('"GROUPING_') || JSON.stringify(stmt.orderBy).includes('"GROUPING_');
37738
37739
  if (normalized.type === "GROUPING_SETS" || hasGroupingNodes) {
37739
37740
  const resolver = await buildGroupingFieldResolver(stmt, client, cacheContext, materializedTables);
37740
37741
  const resolvedSpec = validateGroupingPlanning(