Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15225

QueryPlan.getJSONValue should code against empty string values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The current QueryPlan.getJSONValue implementation is as below:

        public String getJSONValue(Object value) {
          String v = "null";
          if (value != null) {
            v = value.toString();
            if (v.charAt(0) != '[' && v.charAt(0) != '{') {
              v = "\"" + v + "\"";
            }
          }
          return v;
        }
      

      When value.toString() returns an empty string, a StringIndexOutOfRangeException would be thrown out when "v.charAt(0)" is evaluated.

      Attachments

        1. HIVE-15225.1.patch
          0.6 kB
          Yibing Shi

        Activity

          People

            Yibing Yibing Shi
            Yibing Yibing Shi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: