[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-06 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

[~blerer] I added CI to the PRs. I'll assume a +1 and leave you until tomorrow, 
if you want to take a last look, when I'll commit.

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-06 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-15269:


{quote}I can move this forward across the finish line if you're busy somewhere 
else.{quote}

It would be nice.

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-05 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

[~blerer] lgtm +1. Your PR fails to run the test on some rat report error but 
upon rebase vs 4.0 it works. I left a minor nit comment in the PR. I can move 
this forward across the finish line if you're busy somewhere else.

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-03 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-15269:


Sorry, I realize that my commit description was confusing. The 
{{ClassCastException}} is happening on the server NOT on the driver side but it 
is occuring while the sever serialize the message to the driver. The new unit 
test check exactly the code path that was leading to the  
{{ClassCastException}} . 

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-03 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-15269:


The old PR was relying on a hack for testing the fix. The new PR unit reproduce 
the scenario that lead to the {{ClassCastException}} without relying on any 
hack.  

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-03 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

[~blerer] lgtm but I a missing sthg here. What's the benefit of the new PR vs 
the old one, they both seem equally involved. You mention the driver and I am 
not familiar with that side of things so what am I missing? Thx

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-02 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-15269:


[~bereng] Sorry, for the delay. There are a simple way to trigger the 
{{ClassCastException}} without changing anything to the code.
I pushed a new version of the patch 
[here|https://github.com/apache/cassandra/commit/473e67199eb29f831000782ab25cdf56629af1c8].
 CI results: 
[j8|https://app.circleci.com/pipelines/github/blerer/cassandra/191/workflows/d85e9e9f-7b7e-4d4b-83d2-53a6515a7c50]
 and 
[j11|https://app.circleci.com/pipelines/github/blerer/cassandra/191/workflows/4b73dbbb-1451-426e-8217-0af2fef0bf55]

Tell me if the changes look good to you.   

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-06-15 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

There it goes:

{noformat}
[cqlsh 6.0.0 | Cassandra 4.0-rc2-SNAPSHOT | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
cqlsh> select numerator % denominator from test.d;
Traceback (most recent call last):
  File "/home/bereng/work/repos/bdpWS/15269/bin/cqlsh.py", line 1076, in 
perform_simple_statement
result = future.result()
  File 
"/home/bereng/work/repos/bdpWS/15269/bin/../lib/cassandra-driver-internal-only-3.25.0.zip/cassandra-driver-3.25.0/cassandra/cluster.py",
 line 4894, in result
raise self._final_exception
cassandra.FunctionFailure: Error from server: code=1400 [User Defined Function 
failure] message="The operation 'decimal % decimal' failed: Division impossible"

cqlsh> select * from test.d;

 numerator| denominator
--+-
 123456789112345678921234567893123456 |   2

(1 rows)
{noformat}

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-06-11 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-15269:


You should not get: 'system._modulo[decimal, decimal]' as it is supposed to be 
hidden from the user. Instead we should have 'decimal % decimal' (as it is a 
bit further in the message).

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0-rc2, 4.0, 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-06-11 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

Thx!

So if I didn't get things wrong is this what we're after?

{noformat}
[cqlsh 6.0.0 | Cassandra 4.0-rc2-SNAPSHOT | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
cqlsh> select numerator % denominator from test.d;
Traceback (most recent call last):
  File "/home/bereng/work/repos/bdpWS/15269/bin/cqlsh.py", line 1076, in 
perform_simple_statement
result = future.result()
  File 
"/home/bereng/work/repos/bdpWS/15269/bin/../lib/cassandra-driver-internal-only-3.25.0.zip/cassandra-driver-3.25.0/cassandra/cluster.py",
 line 4894, in result
raise self._final_exception
cassandra.FunctionFailure: Error from server: code=1400 [User Defined Function 
failure] message="execution of 'system._modulo[decimal, decimal]' failed: the 
operation 'decimal % decimal' failed: Division impossible"

cqlsh> select * from test.d;

 numerator| denominator
--+-
 123456789112345678921234567893123456 |   2

(1 rows)
{noformat}

PR is [here|https://github.com/apache/cassandra/pull/1057] with the mentioned 
revert so that it can be tested with the repro steps at the top of the ticket. 
Once we agree is good I'll remove the revert.

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Berenguer Blasi
>Priority: Normal
> Fix For: 4.0-rc2, 4.0, 4.0.x
>
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-06-10 Thread Liudmila Kornilova (Jira)


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

Liudmila Kornilova commented on CASSANDRA-15269:


[~bereng], no problem :)

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Liudmila Kornilova
>Priority: Normal
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-06-09 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-15269:
-

[~Override] do you mind I hijack this one from you?

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Liudmila Kornilova
>Priority: Normal
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2019-08-21 Thread Liudmila Kornilova (Jira)


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

Liudmila Kornilova commented on CASSANDRA-15269:


Hi [~andrew.tolbert],

Thank you for reviewing my commit!

I moved error code description from v4 to v5
 How to find out versions of Cassandra and CQL that will use v5?
 I know that I can execute {{"select release_version, cql_version, 
native_protocol_version from system.local"}}, but it gives v4 protocol for 
4.0-SNAPSHOT Cassandra and 3.4.5 cql

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Liudmila Kornilova
>Priority: Normal
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2019-08-20 Thread Andy Tolbert (Jira)


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

Andy Tolbert commented on CASSANDRA-15269:
--

I made a small comment that this should be part of the protocol v5 spec instead 
of v4, but other than that I think this looks good.  I went ahead and created a 
java driver ticket for awareness: 
[JAVA-2397|https://datastax-oss.atlassian.net/browse/JAVA-2397]. The native 
protocol change will be great for the 4.0 java driver.  We should also consider 
making the change in the 3.0 driver since that intends on supporting C* 4.0 as 
well.

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Liudmila Kornilova
>Priority: Normal
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15269) Cassandra fails to process OperationExecutionException which causes ClassCastException

2019-08-20 Thread Liudmila Kornilova (Jira)


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

Liudmila Kornilova commented on CASSANDRA-15269:


Each {{ExceptionCode}} correspond to specific exception class.
 {{OperationExecutionException}} did not have it's own code, instead it used 
{{FUNCTION_FAILURE}} code. So the exception was treated as 
{{FunctionExecutionException}}

I added {{OPERATION_FAILURE}} code

How to test:
 revert locally d60e7988736ed4358595e9c781b110a5bbb5f812 commit (void result 
truncate in decimal operations)
Or throw {{ArithmeticException}} in {{DecimalType.mod}}
{noformat}
try (CqlSession session = CqlSession.builder().build()) {
session.execute("drop table if exists d");
session.execute("create table d (n decimal primary key, d decimal)");
session.execute("insert into d (n, d) values 
(123456789112345678921234567893123456, 2)");
session.execute("select n % d from my.d");
}
{noformat}
What used to be:
{noformat}
Exception in thread "main" 
com.datastax.oss.driver.api.core.servererrors.ServerError: 
java.lang.ClassCastException: 
org.apache.cassandra.exceptions.OperationExecutionException cannot be cast to 
org.apache.cassandra.exceptions.FunctionExecutionException
at 
com.datastax.oss.driver.api.core.servererrors.ServerError.copy(ServerError.java:54)
{noformat}
What is now:
{noformat}
Exception in thread "main" 
com.datastax.oss.driver.api.core.DriverExecutionException
at 
com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:150)
...
Caused by: java.lang.IllegalArgumentException: Unsupported error code: 5888
{noformat}
New error code should be added to Datastax Cassandra Native Protocol in 
[ProtocolConstants.java|https://github.com/datastax/native-protocol/blob/1.x/src/main/java/com/datastax/oss/protocol/internal/ProtocolConstants.java#L70]

If this commit is merged, I'll write a patch to the protocol

> Cassandra fails to process OperationExecutionException which causes 
> ClassCastException
> --
>
> Key: CASSANDRA-15269
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15269
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Liudmila Kornilova
>Assignee: Liudmila Kornilova
>Priority: Normal
>
> While working on CASSANDRA-15232 I noticed that OperationExecutionException 
> is not processed correctly.
> How to reproduce the issue:
>  1. {{create table d (numerator decimal primary key, denominator decimal);}}
>  2. {{insert into d (numerator, denominator) values 
> (123456789112345678921234567893123456, 2);}}
>  3. {{select numerator % denominator from d;}}
> What happens:
>  1. remainder operation throws ArithmeticException (BigDecimal:1854)
>  2. The exception is wrapped in OperationExecutionException
>  3. ClassCastException appears (OperationExecutionException cannot be cast to 
> FunctionExecutionException at ErrorMessage.java:280)
> What should happen:
> OperationExecutionException with message "the operation 'decimal % decimal' 
> failed: Division impossible" should be delivered to user 
> Note that after fixing CASSANDRA-15232 {{select numerator % denominator from 
> d;}} will produce correct result of remainder operation.
>  Currently I am not aware of other cases when OperationExecutionException may 
> be treated as FunctionExecutionException



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org