Skip to content

Commit df5744f

Browse files
author
chengyitian
committed
AJ-859: fix issue about MTW use getStreamTableTimestamp when table not streaming table;
1 parent 8d960ff commit df5744f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/com/xxdb/multithreadedtablewriter/MultithreadedTableWriter.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,14 @@ private void init(String hostName, int port, String userId, String password,
564564
BasicTable colDefs = (BasicTable)schema.get(new BasicString("colDefs"));
565565
BasicIntVector colDefsTypeInt = (BasicIntVector)colDefs.getColumn("typeInt");
566566
try {
567-
BasicString streamTableTimestampColName = (BasicString) pConn.run("getStreamTableTimestamp(" + tableName_ + ")");
568-
if (Objects.nonNull(streamTableTimestampColName)) {
569-
isSetStreamTableTimestamp = true;
567+
if (dbName.isEmpty()) {
568+
Entity tableType = pConn.run("typestr(" + tableName + ")");
569+
if (tableType.getString().equals("STREAMING TABLE")) {
570+
BasicString streamTableTimestampColName = (BasicString) pConn.run("getStreamTableTimestamp(" + tableName_ + ")");
571+
if (Objects.nonNull(streamTableTimestampColName)) {
572+
isSetStreamTableTimestamp = true;
573+
}
574+
}
570575
}
571576
} catch (Exception e) {
572577
if (!e.getMessage().contains("Cannot recognize the token getStreamTableTimestamp")) {

0 commit comments

Comments
 (0)