diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java b/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java index 1cf79b6dc123..b5c5ce608844 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java @@ -277,6 +277,7 @@ public static DruidQuery fromPartialQuery( if (partialQuery.getWindow() != null) { if (plannerContext.featureAvailable(EngineFeature.WINDOW_FUNCTIONS)) { + assert (virtualColumnRegistry.isEmpty()); windowing = Preconditions.checkNotNull( Windowing.fromCalciteStuff( partialQuery, diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java b/sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java index d94b3bb3b19f..bc35b5412d8a 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java @@ -142,8 +142,6 @@ public static Windowing fromCalciteStuff( } for (int i = 0; i < window.groups.size(); ++i) { - - // FIXME: I think this should be recreated after every group VirtualColumnRegistry virtualColumnRegistry = VirtualColumnRegistry.create( sourceRowSignature, plannerContext.getExpressionParser(),