zhztheplayer commented on a change in pull request #1187: [CALCITE-3029] 
Java-oriented field type is wrongly forced to be NOT N…
URL: https://github.com/apache/calcite/pull/1187#discussion_r279278125
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/tools/PlannerTest.java
 ##########
 @@ -703,6 +705,24 @@ private void runDuplicateSortCheck(String sql, String 
plan) throws Exception {
             + "    EnumerableTableScan(table=[[hr, emps]])\n"));
   }
 
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-3029";>[CALCITE-3029]
+   * Java-oriented field type is wrongly forced to be NOT NULL after being 
converted to
+   * SQL-oriented</a>. */
+  @Test public void testInsertSourceRelTypeWithNullValues() throws Exception {
+    Planner planner = getPlanner(null, Programs.standard());
+    SqlNode parse = planner.parse(
+        "insert into \"emps\" values(1, 1, null, 1, 1)");
+    SqlNode validate = planner.validate(parse);
+    RelNode convert = planner.rel(validate).rel;
+    RelDataType insertSourceType = convert.getInput(0).getRowType();
+    String typeString = SqlTests.getTypeString(insertSourceType);
+    assertEquals(typeString,
 
 Review comment:
   My mistake. Thanks!

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to