@@ -1271,6 +1271,7 @@ private static class TableDiskUsageSupplier implements IInformationSchemaContent
12711271 private final Filter pushDownFilter ;
12721272 private final PaginationController paginationController ;
12731273 private final OperatorContext operatorContext ;
1274+ private final Map <String , String > currentTableTypeMap = new HashMap <>();
12741275
12751276 private DataRegion currentDataRegion ;
12761277 private boolean currentDatabaseOnlyHasOneTable ;
@@ -1347,6 +1348,7 @@ private boolean hasNextInternal() {
13471348 try {
13481349 while (dataRegionIterator .nextDataRegion ()) {
13491350 currentDataRegion = dataRegionIterator .currentDataRegion ();
1351+ currentTableTypeMap .clear ();
13501352 for (Long timePartition : currentDataRegion .getTsFileManager ().getTimePartitions ()) {
13511353 Map <String , Long > tablesToScan = getTablesToScan (currentDataRegion , timePartition );
13521354 if (!tablesToScan .isEmpty ()) {
@@ -1420,12 +1422,13 @@ private Map<String, Long> getTablesToScan(DataRegion dataRegion, long timePartit
14201422 }
14211423 totalValidTableCount ++;
14221424 if (pushDownFilter != null ) {
1423- Object [] row = new Object [5 ];
1425+ Object [] row = new Object [6 ];
14241426 row [0 ] = new Binary (dataRegion .getDatabaseName (), TSFileConfig .STRING_CHARSET );
14251427 row [1 ] = new Binary (tTableInfo .getTableName (), TSFileConfig .STRING_CHARSET );
1426- row [2 ] = IoTDBDescriptor .getInstance ().getConfig ().getDataNodeId ();
1427- row [3 ] = dataRegion .getDataRegionId ();
1428- row [4 ] = timePartition ;
1428+ row [2 ] = new Binary (getTableTypeName (tTableInfo ), TSFileConfig .STRING_CHARSET );
1429+ row [3 ] = IoTDBDescriptor .getInstance ().getConfig ().getDataNodeId ();
1430+ row [4 ] = dataRegion .getDataRegionId ();
1431+ row [5 ] = timePartition ;
14291432 if (!pushDownFilter .satisfyRow (0 , row )) {
14301433 continue ;
14311434 }
@@ -1439,11 +1442,19 @@ private Map<String, Long> getTablesToScan(DataRegion dataRegion, long timePartit
14391442 }
14401443 paginationController .consumeLimit ();
14411444 tablesToScan .put (tTableInfo .getTableName (), 0L );
1445+ currentTableTypeMap .put (tTableInfo .getTableName (), getTableTypeName (tTableInfo ));
14421446 }
14431447 currentDatabaseOnlyHasOneTable = totalValidTableCount == 1 ;
14441448 return tablesToScan ;
14451449 }
14461450
1451+ private String getTableTypeName (final TTableInfo tableInfo ) {
1452+ if (tableInfo .isSetType ()) {
1453+ return TableType .values ()[tableInfo .getType ()].getName ();
1454+ }
1455+ return TableType .BASE_TABLE .getName ();
1456+ }
1457+
14471458 @ Override
14481459 public TsBlock next () {
14491460 if (!hasNext ()) {
@@ -1531,10 +1542,12 @@ private TsBlock buildTsBlock() {
15311542 columns [0 ].writeBinary (
15321543 new Binary (currentDataRegion .getDatabaseName (), TSFileConfig .STRING_CHARSET ));
15331544 columns [1 ].writeBinary (new Binary (tableName , TSFileConfig .STRING_CHARSET ));
1534- columns [2 ].writeInt (IoTDBDescriptor .getInstance ().getConfig ().getDataNodeId ());
1535- columns [3 ].writeInt (currentDataRegion .getDataRegionId ());
1536- columns [4 ].writeLong (timePartition );
1537- columns [5 ].writeLong (size );
1545+ columns [2 ].writeBinary (
1546+ new Binary (currentTableTypeMap .get (tableName ), TSFileConfig .STRING_CHARSET ));
1547+ columns [3 ].writeInt (IoTDBDescriptor .getInstance ().getConfig ().getDataNodeId ());
1548+ columns [4 ].writeInt (currentDataRegion .getDataRegionId ());
1549+ columns [5 ].writeLong (timePartition );
1550+ columns [6 ].writeLong (size );
15381551 builder .declarePosition ();
15391552 }
15401553 }
0 commit comments