zoudan commented on code in PR #3111:
URL: https://github.com/apache/calcite/pull/3111#discussion_r1138180373


##########
testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java:
##########
@@ -441,8 +437,106 @@ protected MockCatalogReaderSimple(RelDataTypeFactory 
typeFactory,
       struct10View.addColumn(column.getName(), column.type);
     }
     registerTable(struct10View);
+  }
+
+  @Override public MockCatalogReaderSimple init() {
+    final Fixture fixture = new Fixture(typeFactory);
+
+    // Register "SALES" schema.
+    MockSchema salesSchema = new MockSchema("SALES");
+    registerSchema(salesSchema);
+
+    // Register "EMP" table with customer InitializerExpressionFactory
+    // to check whether newDefaultValue method called or not.
+    final InitializerExpressionFactory countingInitializerExpressionFactory =
+        new CountingFactory(ImmutableList.of("DEPTNO"));
+
+    registerType(
+        ImmutableList.of(salesSchema.getCatalogName(), salesSchema.getName(),
+            "customBigInt"),
+        typeFactory -> typeFactory.createSqlType(SqlTypeName.BIGINT));
+
+    // Register "EMP" table.
+    final MockTable empTable =
+        MockTable.create(this, salesSchema, "EMP", false, 14, null,
+            countingInitializerExpressionFactory, false);
+    registerTableEmp(empTable, fixture);
+
+    // Register "EMPNULLABLES" table with nullable columns.
+    final MockTable empNullablesTable =
+        MockTable.create(this, salesSchema, "EMPNULLABLES", false, 14);
+    registerTableEmpNullables(empNullablesTable, fixture);
+
+    // Register "EMPDEFAULTS" table with default values for some columns.
+    registerTableEmpDefaults(salesSchema, fixture);
+
+    // Register "EMP_B" table. As "EMP", birth with a "BIRTHDATE" column.
+    registerTableEmpB(salesSchema, fixture);
+
+    // Register "DEPT" table.

Review Comment:
   Agree with @julianhyde, I prefer to keep them



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to