[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cassandra-dev
Subject:    Re: "[applied]" column in ModificationStatement?
From:       Brian O'Neill <bone () alumni ! brown ! edu>
Date:       2014-02-06 21:13:45
Message-ID: CF19647E.94838%bone () alumni ! brown ! edu
[Download RAW message or body]

Thanks Jonathan.  
It feels a little weird, but that will work.

Not a big deal, but maybe we could include a wasApplied() method on the
ResultSet in the future that would insulate clients from the ResultSet
schema/column name.

-brian


---
Brian O'Neill
Chief Technology Officer

Health Market Science
The Science of Better Results
2700 Horizon Drive • King of Prussia, PA • 19406
M: 215.588.6024 • @boneill42 <http://www.twitter.com/boneill42>  •
healthmarketscience.com

This information transmitted in this email message is for the intended
recipient only and may contain confidential and/or privileged material. If
you received this email in error and are not the intended recipient, or
the person responsible to deliver it to the intended recipient, please
contact the sender at the email above and delete this email and any
attachments and destroy any copies thereof. Any review, retransmission,
dissemination, copying or other use of, or taking any action in reliance
upon, this information by persons or entities other than the intended
recipient is strictly prohibited.
 






On 2/6/14, 2:58 PM, "Jonathan Ellis" <jbellis@gmail.com> wrote:

>In Cassandra, it's ModificationStatement.CAS_RESULT_COLUMN.text
>
>On Thu, Feb 6, 2014 at 10:22 AM, Brian O'Neill <bone@alumni.brown.edu>
>wrote:
>> Silly questionÅ 
>>
>> Using the CQL driver for conditional updates, I ¹m looking into the
>>ResultSet
>> that comes back:
>>         for (ColumnDefinitions.Definition definition :
>> results.getColumnDefinitions().asList()) {
>>             for (Row row : results.all()) {
>>                 LOG.debug("UPDATE APPLIED = [{}]=[{}]",
>> definition.getName(), row.getBool(definition.getName()));
>>             }
>>         }
>>
>> I noticed that the ResultSet of a conditional update contains a column
>>  ³[applied] ², with a boolean indicating whether or not the update was
>> applied.
>>
>> I assume this column name comes from:
>> 
>>src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:
>>50
>>    private static final ColumnIdentifier CAS_RESULT_COLUMN = new
>> ColumnIdentifier("[applied]", false);
>>
>> Does it make sense to expose this column name as a String constant
>> somewhere?
>> Either in the CQL java-driver, or Cassandra itself?
>>
>> -brian
>>
>> ---
>> Brian O'Neill
>> Chief Technology Officer
>>
>>
>> Health Market Science
>> The Science of Better Results
>> 2700 Horizon Drive € King of Prussia, PA € 19406
>> M: 215.588.6024 € @boneill42 <http://www.twitter.com/boneill42>   €
>> healthmarketscience.com
>>
>>
>> This information transmitted in this email message is for the intended
>> recipient only and may contain confidential and/or privileged material.
>>If
>> you received this email in error and are not the intended recipient, or
>>the
>> person responsible to deliver it to the intended recipient, please
>>contact
>> the sender at the email above and delete this email and any attachments
>>and
>> destroy any copies thereof. Any review, retransmission, dissemination,
>> copying or other use of, or taking any action in reliance upon, this
>> information by persons or entities other than the intended recipient is
>> strictly prohibited.
>>
>>
>>
>
>
>
>-- 
>Jonathan Ellis
>Project Chair, Apache Cassandra
>co-founder, http://www.datastax.com
>@spyced


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic