Type inference in slicing predicates

1 view
Skip to first unread message

Daniel Lundin

unread,
Aug 19, 2010, 5:43:41 PM8/19/10
to pycassa-devel
That was the idea, yeah. I'm not entirely convinced its a good idea
(explicit vs implicit, etc).
At the very least we should probably have util functions to for
example convert a datetime to a uuid1.bytes.

On Aug 18, 8:45 pm, Tyler Hobbs <ty...@riptano.com> wrote:
> Daniel, are you suggesting converting datetime slice arguments to uuid1s if
> that's column type?

Tyler Hobbs

unread,
Aug 19, 2010, 7:13:05 PM8/19/10
to pycass...@googlegroups.com
It seems to me (and correct me if I'm wrong) that the only reason to use
uuid1s instead of long timestamps for column names is to avoid collisions.
Grabbing a time slice of columns is a pretty common use, so we should
make it as straightforward as possible.  I seriously doubt that anybody wants
to grab a time slice *and* start/end not only by timestamp, but also the other
components of a uuid1.  I think converting a timestamp for the start column
to the lowest uuid1 of the same timestamp and converting the end column
to the highest uuid1 of the same timestamp would be a very reasonable
thing to do.  I propose doing this implicitly if passed timestamps where the
column names are TimeUUIDs.

What does everyone else think?

Eric Evans

unread,
Aug 19, 2010, 10:33:31 PM8/19/10
to pycass...@googlegroups.com
On Thu, Aug 19, 2010 at 6:13 PM, Tyler Hobbs <ty...@riptano.com> wrote:
> It seems to me (and correct me if I'm wrong) that the only reason to use
> uuid1s instead of long timestamps for column names is to avoid collisions.
> Grabbing a time slice of columns is a pretty common use, so we should
> make it as straightforward as possible.  I seriously doubt that anybody
> wants
> to grab a time slice *and* start/end not only by timestamp, but also the
> other
> components of a uuid1.  I think converting a timestamp for the start column
> to the lowest uuid1 of the same timestamp and converting the end column
> to the highest uuid1 of the same timestamp would be a very reasonable
> thing to do.  I propose doing this implicitly if passed timestamps where the
> column names are TimeUUIDs.
>
> What does everyone else think?

To clarify, you're saying that if someone does a slice on a column
family that uses TimeUUIDType as the comparator, and they pass in
start and/or end arguments of type datetime, that you would implicitly
convert these to UUID1 to use as query arguments? Is that right?

If so, that sounds pretty reasonable to me.

> On Thu, Aug 19, 2010 at 4:43 PM, Daniel Lundin <d...@eintr.org> wrote:
>>
>> That was the idea, yeah. I'm not entirely convinced its a good idea
>> (explicit vs implicit, etc).
>> At the very least we should probably have util functions to for
>> example convert a datetime to a uuid1.bytes.
>>
>> On Aug 18, 8:45 pm, Tyler Hobbs <ty...@riptano.com> wrote:
>> > Daniel, are you suggesting converting datetime slice arguments to uuid1s
>> > if
>> > that's column type?


--
Eric Evans
john.er...@gmail.com

Reply all
Reply to author
Forward
0 new messages