Phoenix Tips (5) 使用任意时间戳

在Property里面设置属性 "CurrentSCN"。

ts是一个long。


Properties props = new Properties();
props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts));
Connection conn = DriverManager.connect(myUrl, props);

conn.createStatement().execute("UPSERT INTO myTable VALUES ('a')");
conn.commit();

相当于:

myTable.put(Bytes.toBytes('a'),ts);




原文地址:https://www.cnblogs.com/leeeee/p/7276375.html