Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Jeff Jirsa
On 2016-12-03 08:44 (-0800), Edward Capriolo wrote: > On Sat, Dec 3, 2016 at 11:01 AM, Edward Capriolo > wrote: > > > > > > > A new unique timeuuid (at the time where the statement using it is > > executed). > > > > Indicates that each statement

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
On Sat, Dec 3, 2016 at 11:01 AM, Edward Capriolo wrote: > > > On Saturday, December 3, 2016, Edward Capriolo > wrote: > >> >> >> On Saturday, December 3, 2016, Jonathan Haddad wrote: >> >>> That isn't what the original thread is

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
On Saturday, December 3, 2016, Edward Capriolo wrote: > > > On Saturday, December 3, 2016, Jonathan Haddad > wrote: > >> That isn't what the original thread is about. The thread is about the >>

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
On Saturday, December 3, 2016, Jonathan Haddad wrote: > That isn't what the original thread is about. The thread is about the > timestamp portion of the UUID being different. > > Having UUID() return the same thing for all rows in a batch would be the > unexpected thing

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Jonathan Haddad
That isn't what the original thread is about. The thread is about the timestamp portion of the UUID being different. Having UUID() return the same thing for all rows in a batch would be the unexpected thing virtually every time. On Sat, Dec 3, 2016 at 7:09 AM Edward Capriolo

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
On Friday, December 2, 2016, Jonathan Haddad wrote: > This isn't about using the same UUID though. It's about the timestamp bits > in the UUID. > > What the use case is for generating multiple UUIDs in a single row? Why do > you need to extract the timestamp out of both? > On

Re: Why does `now()` produce different times within the same query?

2016-12-02 Thread Jonathan Haddad
This isn't about using the same UUID though. It's about the timestamp bits in the UUID. What the use case is for generating multiple UUIDs in a single row? Why do you need to extract the timestamp out of both? On Fri, Dec 2, 2016 at 10:24 AM Edward Capriolo wrote: > > On

Re: Why does `now()` produce different times within the same query?

2016-12-02 Thread Edward Capriolo
On Thu, Dec 1, 2016 at 11:09 AM, Sylvain Lebresne wrote: > On Thu, Dec 1, 2016 at 4:44 PM, Edward Capriolo > wrote: > >> >> I am not sure you saw my reply on thread but I believe everyone's needs >> can be met I will copy that here: >> > > I saw it,

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Ben Bromhead
> > > > I will note that Ben seems to suggest keeping the return of now() unique > across > call while keeping the time component equals, thus varying the rest of the > uuid > bytes. However: > - I'm starting to wonder what this would buy us. Why would someone be > super >confused by the time

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Marko Švaljek
One millisecond is not an issue in most of Internet of Things projects out there. There are lots of connection related things that add far more latency to the requests than that. Especially if you take into account the time it takes for the data to actually come to a cassandra node in the

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Cody Yancey
On Thu, Dec 1, 2016 at 11:09 AM Sylvain Lebresne wrote: > there is much much more trivial solution: generate it client side. The > `now()` function is a small convenience but there is nothing you cannot do > without it client side > Please see my post above as to why this

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Edward Capriolo
On Thu, Dec 1, 2016 at 11:09 AM, Sylvain Lebresne wrote: > On Thu, Dec 1, 2016 at 4:44 PM, Edward Capriolo > wrote: > >> >> I am not sure you saw my reply on thread but I believe everyone's needs >> can be met I will copy that here: >> > > I saw it,

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Jonathan Haddad
+1 to everything Sylvan said. On Thu, Dec 1, 2016 at 11:09 AM Sylvain Lebresne wrote: > On Thu, Dec 1, 2016 at 4:44 PM, Edward Capriolo > wrote: > > > I am not sure you saw my reply on thread but I believe everyone's needs > can be met I will copy

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Sylvain Lebresne
On Thu, Dec 1, 2016 at 4:44 PM, Edward Capriolo wrote: > > I am not sure you saw my reply on thread but I believe everyone's needs > can be met I will copy that here: > I saw it, but the real problem that was raised initially was not that of UDF and of allowing both

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Bruce Heath
Get Outlook for Android<https://aka.ms/ghei36> From: Edward Capriolo <edlinuxg...@gmail.com> Sent: Thursday, December 1, 2016 10:44:10 AM To: user@cassandra.apache.org Subject: Re: Why does `now()` produce different times within the same query? O

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Edward Capriolo
On Thu, Dec 1, 2016 at 4:06 AM, Sylvain Lebresne wrote: > One can of course always open a JIRA, but I'm going to strongly disagree > with a > change here (outside of a documentation one that is). > > The now() function is a timeuuid generator, and it thus generates a unique

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Sylvain Lebresne
One can of course always open a JIRA, but I'm going to strongly disagree with a change here (outside of a documentation one that is). The now() function is a timeuuid generator, and it thus generates a unique timeuuid on every call, as specified by the timeuuid spec. I'll note that document lists

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Benjamin Roth
Great comment. +1 Am 01.12.2016 06:29 schrieb "Ben Bromhead" : > tl;dr +1 yup raise a jira to discuss how now() should behave in a single > statement (and possible extend to batch statements). > > The values of now should be the same if you assume that now() works like > it

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Ben Bromhead
tl;dr +1 yup raise a jira to discuss how now() should behave in a single statement (and possible extend to batch statements). The values of now should be the same if you assume that now() works like it does in relational databases such as postgres or mysql, however at the moment it instead works

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Edward Capriolo
On Wed, Nov 30, 2016 at 10:53 PM, Cody Yancey wrote: > This is not a bug, and in fact changing it would be a serious bug. > > False. Absolutely no consumer would be broken by a change to guarantee an > identical time component that isn't broken already, for the simple reason

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Cody Yancey
This is not a bug, and in fact changing it would be a serious bug. False. Absolutely no consumer would be broken by a change to guarantee an identical time component that isn't broken already, for the simple reason your code already has to handle that case, as it is in fact the majority case

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread daemeon reiydelle
This is not a bug, and in fact changing it would be a serious bug. What it is is a wonderful case of bad coding: would one expect a java/py/bash script that loops on a bunch of read/execut/update calls where each iteration calls time to return the same exact time for the duration of the execution

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Cody Yancey
Getting the same TimeUUID values might be a major problem. Getting two different TimeUUIDs that at least have time component would not be a major problem as this is the main case today. Getting different time components is actually the corner case, and it is a corner case that breaks

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Robert Wille
In my opinion, this is not broken and “fixing” it would break existing code. Consider a batch that includes multiple inserts, each of which inserts the value returned by now(). Getting the same UUID for each insert would be a major problem. Cheers Robert On Nov 30, 2016, at 4:46 PM, Todd

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Todd Fast
FWIW I'd suggest opening a bug--this behavior is certainly quite unexpected and more than just a documentation issue. In general I can't imagine any desirable properties of the current implementation, and there are likely a bunch of latent bugs sitting out there, so it should be fixed. Todd On

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Terry Liu
Sorry for my typo. Obviously, I meant: "It appears that a single query that calls Cassandra's`now()` time function *multiple times *may actually cause a query to write or return different times." Less of a surprise now that I realize more about the implementation, but I agree that more explicit

Re: Why does `now()` produce different times within the same query?

2016-11-29 Thread Marko Švaljek
every now() call in statement is under the hood "replaced" with newly generated uuid. It can happen that they belong to different milliseconds in time. If you need to have same timestamps you need to set them on the client side. @msvaljek 2016-11-29 22:49

Re: Why does `now()` produce different times within the same query?

2016-11-29 Thread Ariel Weisberg
Hi, The function is defined here[1]. I hope my email client isn't butchering the code. public static final Function *nowFct *= new NativeScalarFunction("now", TimeUUIDType.*instance*) { public ByteBuffer execute(ProtocolVersion protocolVersion, List parameters) {

Why does `now()` produce different times within the same query?

2016-11-29 Thread Terry Liu
It appears that a single query that calls Cassandra's `now()` time function may actually cause a query to write or return different times. Is this the expected or defined behavior, and if so, why does it behave like this rather than evaluating `now()` once across an entire statement? This really