Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4643

variables could be reused

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Invalid
    • None
    • None
    • None
    • None

    Description

      In method "compareBinInterSedesDatum" of Class : pig-0.15.0\src\org\apache\pig\data\BinInterSedes.java

      In this method, variables "dt1" and "dt2" could be reused, as shown below, in switch block "case BinInterSedes.BIGINTEGER", "bb1.get()" and "bb2.get()" should be reused "dt1", "dt2" as all other cases did.

      private int compareBinInterSedesDatum(ByteBuffer bb1, ByteBuffer bb2, boolean[] asc) throws IOException {
      byte dt1 = bb1.get();
      byte dt2 = bb2.get();

      switch (dt1) {

      case BinInterSedes.BIGINTEGER: {
      if(...)

      { int sz1 = readSize(bb1, bb1.get()); int sz2 = readSize(bb2, bb2.get()); … }


      case BinInterSedes.BYTEARRAY: {
      if(...)

      { int sz1 = readSize(bb1, dt1); int sz2 = readSize(bb2, dt2); … }
      case BinInterSedes.CHARARRAY: {
      if(...){ int sz1 = readSize(bb1, dt1); int sz2 = readSize(bb2, dt2);… }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            songwang songwanging
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: