chunweilei commented on a change in pull request #1164: [CALCITE-2998] 
RexCopier should support all rex types (Chunwei Lei)
URL: https://github.com/apache/calcite/pull/1164#discussion_r277601839
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rex/RexBuilderTest.java
 ##########
 @@ -558,6 +566,101 @@ private void checkDate(RexNode node) {
     checkBigDecimalLiteral(builder, "-73786976294838206464");
   }
 
+  /** Tests {@link RexCopier#visitOver(RexOver)} */
+  @Test public void testCopyOver() {
+    final RelDataTypeFactory typeFactory =
+        new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
+    final RexBuilder builder = new RexBuilder(typeFactory);
+    final RelDataType type = typeFactory.createSqlType(SqlTypeName.INTEGER);
+    final RexOver node = (RexOver) builder.makeOver(type,
+        SqlStdOperatorTable.COUNT,
+        ImmutableList.of(builder.makeInputRef(type, 0)),
+        ImmutableList.of(builder.makeInputRef(type, 1)),
+        ImmutableList.of(
+            new RexFieldCollation(
+                builder.makeInputRef(type, 2), ImmutableSet.of())),
+        RexWindowBound.create(
+            SqlWindow.createUnboundedPreceding(SqlParserPos.ZERO), null),
+        RexWindowBound.create(
+            SqlWindow.createCurrentRow(SqlParserPos.ZERO), null),
+        true, true, false, false, false);
+    final RexNode copy = builder.copy(node);
 
 Review comment:
   Thanks. I prefer to keep it this way for saving some time~~ 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to