Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4380

Fix performance regression: in creation of FileSelection in ParquetFormatPlugin to not set files if metadata cache is available.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • None
    • None

    Description

      The regression has been caused by the changes in 367d74a65ce2871a1452361cbd13bbd5f4a6cc95 (DRILL-2618: handle queries over empty folders consistently so that they report table not found rather than failing.)

      In ParquetFormatPlugin, the original code created a FileSelection object in the following code:

      return new FileSelection(fileNames, metaRootPath.toString(), metadata, selection.getFileStatusList(fs));
      

      The selection.getFileStatusList call made an inexpensive call to FileSelection.init(). The call was inexpensive because the FileSelection.files member was not set and the code does not need to make an expensive call to get the file statuses corresponding to the files in the FileSelection.files member.
      In the new code, this is replaced by

        final FileSelection newSelection = FileSelection.create(null, fileNames, metaRootPath.toString());
              return ParquetFileSelection.create(newSelection, metadata);
      

      This sets the FileSelection.files member but not the FileSelection.statuses member. A subsequent call to FileSelection.getStatuses ( in ParquetGroupScan() ) now makes an expensive call to get all the statuses.

      It appears that there was an implicit assumption that the FileSelection.statuses member should be set before the FileSelection.files member is set. This assumption is no longer true.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              parthc Parth Chandra
              dgu-atmapr dgu-atmapr
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: