Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-345

ThriftMetaData toString() should not try to load class reflectively

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: parquet-mr
    • Labels:
      None

      Description

      Currently:

        @Override
        public String toString() {
          return "ThriftMetaData" + toExtraMetaData();
        }
      
      /**
         * generates a map of key values to store in the footer
         * @return the key values
         */
        public Map<String, String> toExtraMetaData() {
          final Map<String, String> map = new HashMap<String, String>();
          map.put(THRIFT_CLASS, getThriftClass().getName());
          map.put(THRIFT_DESCRIPTOR, descriptor.toJSON());
          return map;
        }
      

      There's no guarantee that getThriftClass() won't throw (a class in the file footer doesn't actually need to be on the classpath if its never used) – this masks real error when the error message is being generated.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alexlevenson Alex Levenson
                Reporter:
                alexlevenson Alex Levenson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: