clickhouse-sink-connector icon indicating copy to clipboard operation
clickhouse-sink-connector copied to clipboard

show_replica_status view

Open aadant opened this issue 1 year ago • 0 comments

This view would be a good addition to the altinity_sink_connector schema :

 CREATE VIEW altinity_sink_connector.show_replica_status
                                        AS
                                         SELECT
                                             now() - fromUnixTimestamp(JSONExtractUInt(offset_val, 'ts_sec')) AS seconds_behind_source,
                                             toDateTime(fromUnixTimestamp(JSONExtractUInt(offset_val, 'ts_sec')), 'UTC') AS utc_time,
                                             fromUnixTimestamp(JSONExtractUInt(offset_val, 'ts_sec')) AS local_time,
                                             *
                                         FROM altinity_sink_connector.replica_source_info
                                         FINAL

aadant avatar Apr 05 '24 22:04 aadant