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

cqlsh not able to fetch all rows when in batch mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 3.11.7, 4.0-beta1
    • Component/s: Legacy/CQL
    • Labels:
      None

      Description

      The cqlsh in trunk only display the first page when running in the batch mode, i.e. using -execute or -file option. 
       
      It is a change of behavior. In 3.x branches, the cqlsh returns all rows. 
       
      It can be reproduced in 3 steps.

       1. ccm create trunk -v git:trunk -n1 && ccm start
       2. tools/bin/cassandra-stress write n=1k -schema keyspace="keyspace1"   // write 1000 rows
       3. bin/cqlsh -e "SELECT * FROM keyspace1.standard1;"                    // fetch all rows
      

       
      There are 1000 rows written. But the output in step 3 will only list 100 rows, which is the first page. 

      ➜ bin/cqlsh -e "SELECT * FROM keyspace1.standard1" | wc -l
           105

       
      The related change was introduced in https://issues.apache.org/jira/browse/CASSANDRA-11534, where the cqlsh.py script no longer fetch all rows when not using tty in the print_result method. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yifanc Yifan Cai
                Reporter:
                yifanc Yifan Cai
                Authors:
                Yifan Cai
                Reviewers:
                Brandon Williams
              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 0.5h
                  0.5h