[jira] [Comment Edited] (CASSANDRA-17190) Add support for String contatenation through the "+" operator
[ https://issues.apache.org/jira/browse/CASSANDRA-17190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17490967#comment-17490967 ] Benjamin Lerer edited comment on CASSANDRA-17190 at 2/11/22, 2:57 PM: -- Thanks a lot for the patches [~manish.c.ghildi...@gmail.com] was (Author: blerer): Thanks a lot for the patch [~manish.c.ghildi...@gmail.com] > Add support for String contatenation through the "+" operator > - > > Key: CASSANDRA-17190 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17190 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Benjamin Lerer >Assignee: Manish Ghildiyal >Priority: Normal > Labels: AdventCalendar2021, lhf > Fix For: 4.1 > > Time Spent: 3h 50m > Remaining Estimate: 0h > > Since 4.0, Cassandra support operations on numeric types and on some temporal > types. > We should add support for string concatenations through the {{+}} operator. > +Additional information for newcomers:+ > Cassandra has 2 string types: {{Text}} ({{UTF8Type}}) and ascii > ({{AsciiType}}) both are sub-classes of ({{StringType}}). In order to add > support for string concatenation you will need to add a new method to > {{StringType}} and modify {{OperationFcts}} to add the new functions (one for > each combination of types: ascii/ascii, ascii/text, text/ascii and text/text). > The unit test should be added to {{OperationFctsTest}}. > To allow for concatenating constants (eg: SELECT v1 + ' ' + v2 FROM ...) you > will need to add a {{getPreferedTypeFor}} method to > {{org.apache.cassandra.Constants.Type.STRING}} that determine the constant > type based on its content (ascii or not). -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-17190) Add support for String contatenation through the "+" operator
[ https://issues.apache.org/jira/browse/CASSANDRA-17190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17469556#comment-17469556 ] Brandon Williams edited comment on CASSANDRA-17190 at 1/6/22, 3:10 PM: --- I accidentally ran the dtests there without increasing the resources so those failures can be ignored, and everything else looks good, but I also started [!https://ci-cassandra.apache.org/job/Cassandra-devbranch/1347/badge/icon!|https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/1347/pipeline] was (Author: brandon.williams): I accidentally ran the dtests there without increasing the resources so those failures can be ignored, and everything else looks good, but I also started [!https://ci-cassandra.apache.org/job/Cassandra-devbranch/1346/badge/icon!|https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/1346/pipeline] > Add support for String contatenation through the "+" operator > - > > Key: CASSANDRA-17190 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17190 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Benjamin Lerer >Assignee: Manish Ghildiyal >Priority: Normal > Labels: AdventCalendar2021, lhf > Fix For: 4.x > > Time Spent: 2h > Remaining Estimate: 0h > > Since 4.0, Cassandra support operations on numeric types and on some temporal > types. > We should add support for string concatenations through the {{+}} operator. > +Additional information for newcomers:+ > Cassandra has 2 string types: {{Text}} ({{UTF8Type}}) and ascii > ({{AsciiType}}) both are sub-classes of ({{StringType}}). In order to add > support for string concatenation you will need to add a new method to > {{StringType}} and modify {{OperationFcts}} to add the new functions (one for > each combination of types: ascii/ascii, ascii/text, text/ascii and text/text). > The unit test should be added to {{OperationFctsTest}}. > To allow for concatenating constants (eg: SELECT v1 + ' ' + v2 FROM ...) you > will need to add a {{getPreferedTypeFor}} method to > {{org.apache.cassandra.Constants.Type.STRING}} that determine the constant > type based on its content (ascii or not). -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-17190) Add support for String contatenation through the "+" operator
[ https://issues.apache.org/jira/browse/CASSANDRA-17190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17457996#comment-17457996 ] Manish Ghildiyal edited comment on CASSANDRA-17190 at 12/12/21, 4:49 PM: - So to understand correctly, this would enable users to write queries like: 'Select col1 + col2 from' So we basically need to make sense of 'col1 + col2' here. .and a new method in StringType can be something like: {code:java} public abstract ByteBuffer concat(StringType leftType, ByteBuffer left, StringType rightType, ByteBuffer right) throws UnsupportedEncodingException;{code} was (Author: manish.c.ghildi...@gmail.com): So to understand correctly, this would enable users to write queries like: 'Select col1 + col2 from' So we basically need to make sense of 'col1 + col2' here. .and a new method in StringType can be osmerthing like: {code:java} public abstract ByteBuffer concat(StringType leftType, ByteBuffer left, StringType rightType, ByteBuffer right) throws UnsupportedEncodingException;{code} > Add support for String contatenation through the "+" operator > - > > Key: CASSANDRA-17190 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17190 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter >Reporter: Benjamin Lerer >Assignee: Manish Ghildiyal >Priority: Normal > Labels: AdventCalendar2021, lhf > Fix For: 4.x > > > Since 4.0, Cassandra support operations on numeric types and on some temporal > types. > We should add support for string concatenations through the {{+}} operator. > +Additional information for newcomers:+ > Cassandra has 2 string types: {{Text}} ({{UTF8Type}}) and ascii > ({{AsciiType}}) both are sub-classes of ({{StringType}}). In order to add > support for string concatenation you will need to add a new method to > {{StringType}} and modify {{OperationFcts}} to add the new functions (one for > each combination of types: ascii/ascii, ascii/text, text/ascii and text/text). > The unit test should be added to {{OperationFctsTest}}. > To allow for concatenating constants (eg: SELECT v1 + ' ' + v2 FROM ...) you > will need to add a {{getPreferedTypeFor}} method to > {{org.apache.cassandra.Constants.Type.STRING}} that determine the constant > type based on its content (ascii or not). -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org