Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

function

current behavior

existed problem

proposed changesmigration plan

note

CAST(44 AS TIMESTAMP) 

TIMESTAMP(0) NOT NULL

#session timezone: UTC

1970-01-01 00:00:44 

#session timezone: UTC+8

1970-01-01 00:00:44 

The time in BIGINT type usually represents a unixtime semantic, which represents the elapsed time since java epoch(1970-01-01 00:00:00 UTC+0), when convert to a timestamp we should consider local time zone

Support function  TO_TIMESTAMP(numeric_expr, [,scale])

return type: TIMESTAMP(0)This is an invalid behavior, disable the invalid CAST behavior, to get same behavior, user can workaround with: 

#session timezone: UTC

TO_TIMESTAMP(FROM_UNIXTIMESTAMP(44-0))

1970-01-01 00:00:44 

#session timezone: UTC+8

  • TO_TIMESTAMP(FROM_UNIXTIMESTAMP(
-28756
  • 44 -8 * 60 * 60))

1970-01-01 00:00:44

TO_TIMESTAMP(numeric_expr [,scale])

TO_TIMESTAMP(seconds, 0)

TO_TIMESTAMP(mills, 3)

TO_TIMESTAMP(nanoSeconds, 9)

CAST(TIMESTAMP ‘1970-01-01 00:00:44’ AS BIGINT) 

BIGINT NOT NULL

#session timezone: UTC

44 

#session timezone: UTC+8

44

The inverse conversion of above, this conversion is used rarely.

UNIX_TIMESTAMP(TIMESTAMP ‘1970-01-01 00:00:44’)

#session timezone: UTC

44

#session timezone: UTC+8

-28756

...

(2) The cast between NUMERIC and TIMESTAMP is supported.


4. Support defining row time attribute on TIMESTAMP WITH LOCAL TIME ZONE

After this, we can support ROWTIME/PROCTIME on type TIMESTAMP WITH LOCAL TIME ZONE, which complements the unifcation.

...