xiaochangg commented on issue #17353:
URL: https://github.com/apache/iotdb/issues/17353#issuecomment-4132972241
i have got it
get it by using it this way:
SessionInfo sessionInfo = new SessionInfo(
9999L, // sessionId:随便给一个唯一 long 即可(Pipe内部用)
userName, // userName:默认超级管理员 root
ZoneId.systemDefault(), // 时区:必须传,用系统默认就行
dbName,
IClientSession.SqlDialect.TABLE // 重点:你用的是表模型,必须是 TABLE 模式!
);
TEndPoint localDataBlockEndpoint = new TEndPoint("127.0.0.1", port);
TEndPoint localInternalEndpoint = new TEndPoint("127.0.0.1", 10730);
MPPQueryContext queryContext = new MPPQueryContext(
"pipe query", // 随便写一个SQL
QueryId.MOCK_QUERY_ID,
sessionInfo,
localDataBlockEndpoint,
localInternalEndpoint
);
queryContext.setSession(sessionInfo);
Map<String, List<DeviceEntry>> stringListMap =
LocalExecutionPlanner.getInstance()
.metadata.indexScan(new QualifiedObjectName(sid, oriTableName),
Collections.emptyList(),
Arrays.asList("type","type2"),queryContext);
for (String key : stringListMap.keySet()) {
List<DeviceEntry> entryList = stringListMap.get(key);
for (DeviceEntry entry : entryList) {
String deviceId = entry.getDeviceID().toString();
if (attributeKeyCache.containsKey(deviceId)){
continue;
}
Binary[] attributeColumnValues = entry.getAttributeColumnValues();
StringBuilder s = new StringBuilder();
for(Binary binary : attributeColumnValues) {
s.append(",").append(binary.toString());
}
attributeKeyCache.put(deviceId,s.substring(1));
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]