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

this query is not supported in new version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • Legacy/CQL
    • None
    • cassandra 2.1.6
      jdk 1.7.0_55

    • Normal

    Description

      Background:

      1、create a table:

      CREATE TABLE test (
          a int,
          b int,
          c int,
      	d int,
          PRIMARY KEY (a, b, c)
      );
      

      2、query by a=1 and b<6

      select * from test where a=1 and b<6;
      
       a | b | c | d
      ---+---+---+---
       1 | 3 | 1 | 2
       1 | 3 | 2 | 2
       1 | 3 | 4 | 2
       1 | 3 | 5 | 2
       1 | 4 | 4 | 2
       1 | 5 | 5 | 2
      
      (6 rows)
      

      3、query by page
      first page:

      select * from test where a=1 and b<6 limit 2;
       a | b | c | d
      ---+---+---+---
       1 | 3 | 1 | 2
       1 | 3 | 2 | 2
      
      (2 rows)
      

      second page:

      select * from test where a=1 and b<6 and (b,c) > (3,2) limit 2;
       a | b | c | d
      ---+---+---+---
       1 | 3 | 4 | 2
       1 | 3 | 5 | 2
      
      (2 rows)
      

      last page:

      select * from test where a=1 and b<6 and (b,c) > (3,5) limit 2;
       a | b | c | d
      ---+---+---+---
       1 | 4 | 4 | 2
       1 | 5 | 5 | 2
      
      (2 rows)
      

      question:
      this query by page is ok when cassandra 2.0.8.
      but is not supported in the latest version 2.1.6

      when execute:

      select * from test where a=1 and b<6 and (b,c) > (3,2) limit 2;
      

      get one error message:

      InvalidRequest: code=2200 [Invalid query] message="Column "b" cannot have both tuple-notation inequalities and single-column inequalities: (b, c) > (3, 2)"

      Attachments

        1. 9606-2.0.txt
          19 kB
          Benjamin Lerer
        2. 9606-2.1.txt
          21 kB
          Benjamin Lerer
        3. 9606-2.2.txt
          19 kB
          Benjamin Lerer

        Activity

          People

            blerer Benjamin Lerer
            zhaoyan zhaoyan
            Benjamin Lerer
            Sam Tunnicliffe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: