driftx commented on code in PR #1886: URL: https://github.com/apache/cassandra/pull/1886#discussion_r981235663
########## doc/cql3/CQL.textile: ########## @@ -2110,7 +2112,25 @@ will select all rows where the @timeuuid@ column @t@ is strictly older than '201 _Warning_: We called the values generated by @minTimeuuid@ and @maxTimeuuid@ _fake_ UUID because they do no respect the Time-Based UUID generation process specified by the "RFC 4122":http://www.ietf.org/rfc/rfc4122.txt. In particular, the value returned by these 2 methods will not be unique. This means you should only use those methods for querying (as in the example above). Inserting the result of those methods is almost certainly _a bad idea_. -h3(#timeFun). Time conversion functions + +h3(#datetimeFun). Datetime functions + +h4(#curentDateTime). Retrieving the current date/time + +The following functions can be used to retrieve the date/time at the time where the function is invoked: + +|_. function name |_. output type | +| @currentTimestamp@ | @timestamp@ | +| @currentDate@ | @date@ | +| @currentTime@ | @time@ | +| @currentTimeUUID@ | @timeUUID@ | Review Comment: Spacing ########## doc/cql3/CQL.textile: ########## @@ -1984,6 +1984,47 @@ UPDATE plays SET scores = scores - [ 12, 21 ] WHERE id = '123-afde'; // removes As with "maps":#map, TTLs if used only apply to the newly inserted/updated _values_. +h2(#arithmeticOperators). Arithmetic Operators + +h3(#numberArithmetic). Number Arithmetic + +CQL supports the following operators: + +|_. Operator |_. Description | +| @-@ (unary) | Negates operand | +| @+@ | Addition | +| @-@ | Substraction | +| @*@ | Multiplication | +| @/@ | Division | +| @%@ | Returns the remainder of a division | + +Arithmetic operations are only supported on numeric types or counters. + +The return type of the operation will be based on the operand types: + + +|_. left/right |_. @tinyint@ |_. @smallint@ |_. @int@ |_. @bigint@ |_. @counter@ |_. @float@ |_. @double@ |_. @varint@ |_. @decimal@ | Review Comment: formatting ########## doc/cql3/CQL.textile: ########## @@ -1748,6 +1749,7 @@ p. The following table gives additional informations on the native data types, a |@date@ | integers, strings |A date (with no corresponding time value). See "Working with dates":#usingdates below for more information.| |@decimal@ | integers, floats |Variable-precision decimal| |@double@ | integers |64-bit IEEE-754 floating point| +|@duration@ | duration | A duration with nanosecond precision. See "Working with durations":#usingdurations below for details.| Review Comment: spacing ########## doc/cql3/CQL.textile: ########## @@ -1,4 +1,4 @@ -<!-- +!-- Review Comment: Probably still need this :) ########## doc/cql3/CQL.textile: ########## @@ -1997,7 +2038,7 @@ The following table describes the conversions supported by the @cast@ function. |_. from |_. to | |@ascii@ |@text@, @varchar@ | -|@bigint@ |@tinyint@, @smallint@, @int@, @float@, @double@, @decimal@, @varint@, @text@, @varchar@ | +|@bigint@ |@tinyint@, @smallint@, @int@, @float@, @double@, @@decimal@@, @varint@, @text@, @varchar@ | Review Comment: spacing is off-by-one ########## doc/cql3/CQL.textile: ########## @@ -1821,6 +1823,44 @@ They can also be input as string literals in any of the following formats: * @08:12:54.123456@ * @08:12:54.123456789@ +h3(#usingdurations). Working with durations + +Values of the @duration@ type are encoded as 3 signed integer of variable lengths. The first integer represents the Review Comment: integer -> integers -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

