Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-18896

ClientRequestSize metrics should not treat CONTAINS restrictions as being equality-based

    XMLWordPrintableJSON

Details

    Description

      The following behavior needs to be changed to consider the column restricted by CONTAINS or CONTAINS KEY as "read", rather than "provided by the client". We already do this for things like range restrictions, and the current behavior is inconsistent.

      @Test
      public void shouldRecordReadMetricsForContainsQuery() throws Throwable
      {
          createTable("CREATE TABLE %s (pk int, ck int, v set<int>, PRIMARY KEY (pk, ck))");
      
          executeNet(CURRENT, "INSERT INTO %s (pk, ck, v) VALUES (1, 1, {1, 2, 3} )");
          executeNet(CURRENT, "INSERT INTO %s (pk, ck, v) VALUES (2, 2, {4, 5, 6})");
          executeNet(CURRENT, "SELECT * FROM %s WHERE v CONTAINS 1 ALLOW FILTERING");
      
          assertEquals(1, ClientRequestSizeMetrics.totalRowsRead.getCount());
          // The filtering term is provided by the client in the request, so we don't consider that column read.
          assertEquals(2, ClientRequestSizeMetrics.totalColumnsRead.getCount());
      }
      

      The fix should be literally two lines, one in SingleRestriction and one in the test above.

      Attachments

        1. ci_summary.html
          7 kB
          Caleb Rackliffe
        2. result_details.tar.gz
          1.55 MB
          Caleb Rackliffe

        Activity

          People

            maedhroz Caleb Rackliffe
            maedhroz Caleb Rackliffe
            Caleb Rackliffe
            Benjamin Lerer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 40m
                1h 40m