Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2688

Improve diagnosability when return type could not be inferred.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • None
    • None

    Description

      Currently when the return type inferenence fails; a null is returned; while leads to an NPE very quickly - the resulting Exception is not informative at all.

        @Test(expected = IllegalArgumentException.class)
        public void checkNoCommonReturnTypeException() {
          coalesce(vVarchar(1), vInt(2));
        }
      

      example NPE:

      java.lang.NullPointerException
      	at java.util.Objects.requireNonNull(Objects.java:203)
      	at org.apache.calcite.rex.RexCall.<init>(RexCall.java:59)
      	at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:242)
      	at org.apache.calcite.rex.RexBuilder.makeCall(RexBuilder.java:254)
      	at org.apache.calcite.test.RexProgramBuilderBase.coalesce(RexProgramBuilderBase.java:300)
      	at org.apache.calcite.test.RexProgramTest.checkNoCommonReturnTypeException(RexProgramTest.java:753)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

      Attachments

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: