Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C4B7200CD1 for ; Wed, 26 Jul 2017 17:35:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E739E169157; Wed, 26 Jul 2017 15:35:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0D8AC16914C for ; Wed, 26 Jul 2017 17:35:09 +0200 (CEST) Received: (qmail 11034 invoked by uid 500); 26 Jul 2017 15:35:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 11023 invoked by uid 99); 26 Jul 2017 15:35:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2017 15:35:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A927BC20F1 for ; Wed, 26 Jul 2017 15:35:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id vY4SSd5QV5hw for ; Wed, 26 Jul 2017 15:35:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 433565FD41 for ; Wed, 26 Jul 2017 15:35:07 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B73B9E0D57 for ; Wed, 26 Jul 2017 15:35:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 516BA23F1D for ; Wed, 26 Jul 2017 15:35:01 +0000 (UTC) Date: Wed, 26 Jul 2017 15:35:01 +0000 (UTC) From: "Andy Tolbert (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-8871) Non-null paging state returned if last page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 26 Jul 2017 15:35:13 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-8871?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Tolbert updated CASSANDRA-8871: ------------------------------------ Description: tWhen retrieving the next page from the result of a simple statement, the result will return a non-null paging state even if it's the last page of the query. This only happens if it's the last page, and the results of the last page exactly matches the paging size. Schema: {noformat} CREATE KEYSPACE simplex WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; USE simplex; CREATE TABLE test (k text, v int, PRIMARY KEY (k, v)); INSERT INTO test (k, v) VALUES ('a', 0); INSERT INTO test (k, v) VALUES ('b', 1); INSERT INTO test (k, v) VALUES ('c', 2); INSERT INTO test (k, v) VALUES ('d', 3); INSERT INTO test (k, v) VALUES ('e', 4); {noformat} Query: {noformat} result = session.execute("SELECT * FROM test", page_size: 5) loop do puts "last page? #{result.last_page?}" puts "page size: #{result.size}" result.each do |row| puts row end puts "" break if result.last_page? result = result.next_page end {noformat} Result: {noformat} last page? false page size: 5 {"k"=>"a", "v"=>0} {"k"=>"c", "v"=>2} {"k"=>"m", "v"=>12} {"k"=>"f", "v"=>5} {"k"=>"o", "v"=>14} last page? true page size: 0 {noformat} was: When retrieving the next page from the result of a simple statement, the result will return a non-null paging state even if it's the last page of the query. This only happens if it's the last page, and the results of the last page exactly matches the paging size. Schema: {noformat} CREATE KEYSPACE simplex WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; USE simplex; CREATE TABLE test (k text, v int, PRIMARY KEY (k, v)); INSERT INTO test (k, v) VALUES ('a', 0); INSERT INTO test (k, v) VALUES ('b', 1); INSERT INTO test (k, v) VALUES ('c', 2); INSERT INTO test (k, v) VALUES ('d', 3); INSERT INTO test (k, v) VALUES ('e', 4); {noformat} Query: {noformat} result = session.execute("SELECT * FROM test", page_size: 5) loop do puts "last page? #{result.last_page?}" puts "page size: #{result.size}" result.each do |row| puts row end puts "" break if result.last_page? result = result.next_page end {noformat} Result: {noformat} last page? false page size: 5 {"k"=>"a", "v"=>0} {"k"=>"c", "v"=>2} {"k"=>"m", "v"=>12} {"k"=>"f", "v"=>5} {"k"=>"o", "v"=>14} last page? true page size: 0 {noformat} > Non-null paging state returned if last page > ------------------------------------------- > > Key: CASSANDRA-8871 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8871 > Project: Cassandra > Issue Type: Bug > Environment: ruby-driver 2.1.0 | C* 2.0.12 | C* 2.1.3 > Reporter: Kishan Karunaratne > Assignee: Tyler Hobbs > > tWhen retrieving the next page from the result of a simple statement, the result will return a non-null paging state even if it's the last page of the query. This only happens if it's the last page, and the results of the last page exactly matches the paging size. > Schema: > {noformat} > CREATE KEYSPACE simplex WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; > USE simplex; > CREATE TABLE test (k text, v int, PRIMARY KEY (k, v)); > INSERT INTO test (k, v) VALUES ('a', 0); > INSERT INTO test (k, v) VALUES ('b', 1); > INSERT INTO test (k, v) VALUES ('c', 2); > INSERT INTO test (k, v) VALUES ('d', 3); > INSERT INTO test (k, v) VALUES ('e', 4); > {noformat} > Query: > {noformat} > result = session.execute("SELECT * FROM test", page_size: 5) > loop do > puts "last page? #{result.last_page?}" > puts "page size: #{result.size}" > result.each do |row| > puts row > end > puts "" > break if result.last_page? > result = result.next_page > end > {noformat} > Result: > {noformat} > last page? false > page size: 5 > {"k"=>"a", "v"=>0} > {"k"=>"c", "v"=>2} > {"k"=>"m", "v"=>12} > {"k"=>"f", "v"=>5} > {"k"=>"o", "v"=>14} > > last page? true > page size: 0 > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org