Skip to content

Commit e6c8913

Browse files
committed
bishop
1 parent 3e4661b commit e6c8913

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowCreateTableTask.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ private static String getShowCreateTableSQL(final TsTable table) {
9696
.append("TAG");
9797
break;
9898
case TIME:
99-
continue;
99+
builder
100+
.append(getIdentifier(schema.getColumnName()))
101+
.append(" ")
102+
.append(schema.getDataType())
103+
.append(" ")
104+
.append("TIME");
105+
break;
100106
case FIELD:
101107
builder
102108
.append(getIdentifier(schema.getColumnName()))
@@ -123,7 +129,7 @@ private static String getShowCreateTableSQL(final TsTable table) {
123129
builder.append(",");
124130
}
125131

126-
if (table.getColumnList().size() > 1) {
132+
if (!table.getColumnList().isEmpty()) {
127133
builder.deleteCharAt(builder.length() - 1);
128134
}
129135

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowCreateViewTask.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ public static String getShowCreateViewSQL(final TsTable table) {
9999
.append("TAG");
100100
break;
101101
case TIME:
102-
continue;
102+
builder
103+
.append(getIdentifier(schema.getColumnName()))
104+
.append(" ")
105+
.append(schema.getDataType())
106+
.append(" ")
107+
.append("TIME");
108+
break;
103109
case FIELD:
104110
builder
105111
.append(getIdentifier(schema.getColumnName()))
@@ -122,7 +128,7 @@ public static String getShowCreateViewSQL(final TsTable table) {
122128
builder.append(",");
123129
}
124130

125-
if (table.getColumnList().size() > 1) {
131+
if (!table.getColumnList().isEmpty()) {
126132
builder.deleteCharAt(builder.length() - 1);
127133
}
128134

0 commit comments

Comments
 (0)