Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-840

Remove Superfluous Array Fill in RecordReaderImpl

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.0
    • 1.8.0
    • None
    • None

    Description

      public static int[] mapSargColumnsToOrcInternalColIdx(
                                  List<PredicateLeaf> sargLeaves,
                                  SchemaEvolution evolution) {
          int[] result = new int[sargLeaves.size()];
          Arrays.fill(result, -1);
          for(int i=0; i < result.length; ++i) {
            String colName = sargLeaves.get(i).getColumnName();
            result[i] = findColumns(evolution, colName);
          }
          return result;
        }
      

      There is no reason here to pre-populate result with -1 values. They are promptly overwritten in the following loop.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment