shuwenwei commented on code in PR #14617:
URL: https://github.com/apache/iotdb/pull/14617#discussion_r2053595262
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java:
##########
@@ -101,21 +101,31 @@ public boolean tableExists(final QualifiedObjectName
name) {
@Override
public Optional<TableSchema> getTableSchema(
final SessionInfo session, final QualifiedObjectName name) {
- final TsTable table = tableCache.getTable(name.getDatabaseName(),
name.getObjectName());
- return Objects.isNull(table)
- ? Optional.empty()
- : Optional.of(
- new TableSchema(
- table.getTableName(),
- table.getColumnList().stream()
- .map(
- o ->
- new ColumnSchema(
- o.getColumnName(),
- TypeFactory.getType(o.getDataType()),
- false,
- o.getColumnCategory()))
- .collect(Collectors.toList())));
+ final String databaseName = name.getDatabaseName();
+ final String tableName = name.getObjectName();
+
+ TsTable table = tableCache.getTable(databaseName, tableName);
+ if (table == null) {
+ return Optional.empty();
+ }
+ final List<ColumnSchema> columnSchemaList =
+ table.getColumnList().stream()
+ .map(
+ o -> {
+ final ColumnSchema schema =
+ new ColumnSchema(
+ o.getColumnName(),
+ TypeFactory.getType(o.getDataType()),
+ false,
+ o.getColumnCategory());
+ schema.setProps(o.getProps());
+ return schema;
+ })
+ .collect(Collectors.toList());
+ return Optional.of(
+ databaseName.equals(TreeViewSchema.TREE_PATH_PATTERN)
Review Comment:
Maybe props should be used to make the judgement here?
`databaseName.equals(TreeViewSchema.TREE_PATH_PATTERN)` is false
--
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]