是的,将时间戳作为主键的一部分包含在内是完全可以的。请找到代码:
use ${var:db_name};
CREATE TABLE test (
table_name STRING NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
table_id BIGINT NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
last_read_timestamp TIMESTAMP NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
window STRING NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
ext_gen_timestamp timestamp NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
extract_date timestamp NOT NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
manual_rerun STRING NULL ENCODING AUTO_ENCODING COMPRESSION DEFAULT_COMPRESSION,
PRIMARY KEY (table_name, table_id, last_read_timestamp)
)
STORED AS KUDU;
*