Hi Yaobin,

I measured today's behaviour on master 8a5e5ca5444 with three
standalone servers (timestamp_precision ms, us, ns) holding the same
instants. Tree model unless noted.

DERIVATIVE
- The divisor is the stored time difference, not milliseconds: +10
  over 1 s gives 0.01 at ms, 1.0E-5 at us, 1.0E-8 at ns. No unit option.
- NON_NEGATIVE_DERIVATIVE and NON_NEGATIVE_DIFFERENCE return the
  absolute value: a step of -10 gives +10 instead of being dropped.
- One point gives no row. A NULL row is skipped and the next slope
  spans it. A NaN makes both neighbouring results NaN.

INTEGRAL (UDAFIntegral)
- unit takes ns/us/ms/s/m/h/d with a multiplier ("2s"); a unit finer
  than the precision is rejected. NULL and NaN points are skipped.
- One point gives 0.0. The single result row is at timestamp 0.
- A segment that starts at a negative timestamp is skipped: value 1
  from -2 s to 1 s integrates to 1.0 instead of 3.0.
- At ns precision, unit "1h" is rejected and "1d" is 172x too large,
  from an int overflow in the unit conversion.

EQUAL_SIZE_BUCKET_RANDOM_SAMPLE
- Buckets are floor(1/proportion) points: 100 points at 0.3 give 34
  rows, not 30. Two runs return different rows, and there is no seed.

Table model
- DERIVATIVE, DIFFERENCE, INTEGRAL and the sample function fail with
  "701: Unknown function". abs, avg and lag() work in the same session.

Time zone
- No SQL statement sets it. The CLI has "set time_zone=" (no -tz) and
  JDBC a time_zone property; the default is the client JVM zone.
- In a JDBC URL, time_zone=+08:00 fails to parse; Asia/Shanghai works.
- The session zone changes the display and how literals without an
  offset are read, and with it the tree GROUP BY ([start, end), 1d)
  day windows and date_bin(1d, time, origin).
- date_bin(1d, time) without an origin always cuts at UTC midnight.

Suggestion: the document could fix the derivative time unit and say
whether day buckets follow the session zone; today the first depends
on the precision and the second on the syntax used.

Zihan

Reply via email to