Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-18325

NPE may throw when use SqlDataTypeSpec#getNullable

    XMLWordPrintableJSON

Details

    Description

      SqlMapTypeNameSpec#unparse calls SqlDataTypeSpec#getNullable, and "getNullable" may throw NPE

      if (!keyType.getNullable()) { 
        writer.keyword("NOT NULL"); 
      }
      

       

      See in  SqlDataTypeSpec 

      /** Whether data type allows nulls.
       *
       * <p>Nullable is nullable! Null means "not specified". E.g.
       * {@code CAST(x AS INTEGER)} preserves the same nullability as {@code x}.
       */
      private Boolean nullable;
      

       

      This API is from calcite, and all callers will determine if it is null:

       

       

      Attachments

        Activity

          People

            Aron.tao Jiatao Tao
            Aron.tao Jiatao Tao
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: