[jira] [Commented] (CASSANDRA-10272) BATCH statement is broken in cqlsh

2015-09-13 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14742731#comment-14742731
 ] 

Stefania commented on CASSANDRA-10272:
--

Thanks Robert. I've created CASSANDRA-10313 for the unrelated failure.

> BATCH statement is broken in cqlsh
> --
>
> Key: CASSANDRA-10272
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: CentOS 7.1/x64
>Reporter: Vovodroid
>Assignee: Stefania
> Fix For: 3.0.0 rc1, 2.1.10, 2.2.2
>
> Attachments: 10272-2.1.txt
>
>
> BEGIN BATCH  APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-10272) BATCH statement is broken in cqlsh

2015-09-13 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14742422#comment-14742422
 ] 

Robert Stupp commented on CASSANDRA-10272:
--

+1

committed as ae5108645fc5e04888ab5cf08d3a03730b90ff30

> BATCH statement is broken in cqlsh
> --
>
> Key: CASSANDRA-10272
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: CentOS 7.1/x64
>Reporter: Vovodroid
>Assignee: Stefania
> Fix For: 3.0.0 rc1, 2.1.10, 2.2.2
>
> Attachments: 10272-2.1.txt
>
>
> BEGIN BATCH  APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-10272) BATCH statement is broken in cqlsh

2015-09-10 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740268#comment-14740268
 ] 

Stefania commented on CASSANDRA-10272:
--

The dtest is [here|https://github.com/stef1927/cassandra-dtest/commits/10272].

I've run all cqlsh tests locally on 2.1 and 2.2. There is an existing unrelated 
issue, see details below.

The patch attached should apply on all branches without conflict. 

For 3.0 I decided to let CI run so it's verifiable:

https://github.com/stef1927/cassandra/commits/10272-3.0
http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-10272-3.0-dtest/

Details of unrelated failure:

{code}
==
FAIL: test_all_datatypes_read (cqlsh_tests.cqlsh_copy_tests.CqlshCopyTest)
--
Traceback (most recent call last):
  File "/home/stefi/git/cstar/cassandra-dtest/cqlsh_tests/cqlsh_copy_tests.py", 
line 674, in test_all_datatypes_read
self.assertCsvResultEqual(self.tempfile.name, results)
  File "/home/stefi/git/cstar/cassandra-dtest/cqlsh_tests/cqlsh_copy_tests.py", 
line 137, in assertCsvResultEqual
raise e
AssertionError: Element counts were not equal:
First has 1, Second has 0:  ['ascii', '1099511627776', '0xbeef', 'True', 
'3.140124344978758017532527446746826171875', '2.444', '1.1', 
'127.0.0.1', '25', 
'\xe3\x83\xbd(\xc2\xb4\xe3\x83\xbc\xef\xbd\x80)\xe3\x83\x8e', '2005-07-14 
12:30:00', '30757c2c-584a-11e5-b2d0-9cebe804ecbe', 
'2471e7de-41e4-478f-a402-e99ed779be76', 'asdf', '36893488147419103232']
First has 0, Second has 1:  ['ascii', '1099511627776', '0xbeef', 'True', 
'3.140124344978758017532527446746826171875', '2.444', '1.1', 
'127.0.0.1', '25', 
'\xe3\x83\xbd(\xc2\xb4\xe3\x83\xbc\xef\xbd\x80)\xe3\x83\x8e', '2005-07-14 
04:30:00', '30757c2c-584a-11e5-b2d0-9cebe804ecbe', 
'2471e7de-41e4-478f-a402-e99ed779be76', 'asdf', '36893488147419103232']
 >> begin captured logging << 
dtest: DEBUG: cluster ccm directory: /tmp/dtest-8VAvBl
dtest: DEBUG: Importing from csv file: /tmp/tmpGwW8yB
dtest: WARNING: Mismatch at index: 10
dtest: WARNING: Value in csv: 2005-07-14 12:30:00
dtest: WARNING: Value in result: 2005-07-14 04:30:00
- >> end captured logging << -
{code}

I haven't looked into this yet, shall I open a new ticket? I think it may be 
related to timezone however, since my machine is on GMT+08 and the difference 
in time is exactly 8 hours.

> BATCH statement is broken in cqlsh
> --
>
> Key: CASSANDRA-10272
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: CentOS 7.1/x64
>Reporter: Vovodroid
>Assignee: Stefania
> Fix For: 2.1.x, 2.2.x, 3.0.0 rc1
>
> Attachments: 10272-2.1.txt
>
>
> BEGIN BATCH  APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-10272) BATCH statement is broken in cqlsh

2015-09-10 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740139#comment-14740139
 ] 

Stefania commented on CASSANDRA-10272:
--

This was broken by CASSANDRA-9232, thank you for your investigations 
[~vovodroid], which sped things up considerably.

I've attached a patch that I tested manually on 2.1. I will now work on some 
automated dtests.

[~thobbs], the problem is that since when we removed the {{K_*}} identifiers 
(due to the max number of named groups in a python regex), the statement token 
at position zero is simply {{identifier}}, we should therefore look at position 
1, where the keyword entered by the user is stored. Are you happy to be the 
reviewer and if so do you require CI to run on all branches? I plan to just 
write some new cqlsh dtests to catch this functionality otherwise, and run the 
cqlsh tests locally with the text patch applied on 2.1+.

> BATCH statement is broken in cqlsh
> --
>
> Key: CASSANDRA-10272
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: CentOS 7.1/x64
>Reporter: Vovodroid
>Assignee: Stefania
> Fix For: 2.1.x, 2.2.x, 3.0.0 rc1
>
> Attachments: 10272-2.1.txt
>
>
> BEGIN BATCH  APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-10272) BATCH statement is broken in cqlsh

2015-09-08 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14734835#comment-14734835
 ] 

Sylvain Lebresne commented on CASSANDRA-10272:
--

bq. Why not? cqlsh is capable to play external scripts and to accept statements 
from stdin

Sure, and sorry if it sounded like I pretended otherwise. Using batches in 
cqlsh is perfectly fine, and I'm sure this bug affect quite a few users and we 
should absolutely fix it. But cqlsh is first an interactive tool and from my 
experience is used most often for schema manipulation and simple querying, 
which don't involve batches most of the time. I was merely trying to justify 
not bumping the priority over 'major'. And truly, the fact there is a simple 
work-around is the main argument for that.

> BATCH statement is broken in cqlsh
> --
>
> Key: CASSANDRA-10272
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: CentOS 7.1/x64
>Reporter: Vovodroid
>Assignee: Ryan McGuire
> Fix For: 2.2.x, 3.0.0 rc1
>
>
> BEGIN BATCH  APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException:  message="line 0:-1 mismatched input '' expecting K_APPLY">
> SyntaxException:  message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)