Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-120

TestCase doesn't call ResultSet.close

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.2-incubating
    • Fix Version/s: 0.2-incubating
    • Component/s: SQL Shell
    • Labels:
      None

      Description

      Current implementation is

      ResultSet res = tpch.execute("select 100 * sum(" +
              "case when p_type like 'PROMO%' then l_extendedprice else 0.0 end) / sum(l_extendedprice * (1 - l_discount)) "
              + "as promo_revenue from lineitem, part where l_partkey = p_partkey");
      
      assertTrue(res.next());
      assertEquals(33, res.getInt(1));
      

      Changed implementation is

      ResultSet res = tpch.execute("select 100 * sum(" +
              "case when p_type like 'PROMO%' then l_extendedprice else 0.0 end) / sum(l_extendedprice * (1 - l_discount)) "
              + "as promo_revenue from lineitem, part where l_partkey = p_partkey");
      
      try {
        assertTrue(res.next());
        assertEquals(33, res.getInt(1));
      } finally {
        res.close();
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hjkim Hyoungjun Kim
                Reporter:
                hjkim Hyoungjun Kim
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: