[Discussion] Support the LIMIT operator for show segments command
Posted by
haomarch on
Jun 17, 2020; 11:07am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/Discussion-Support-the-LIMIT-operator-for-show-segments-command-tp96567.html
We support show segment as query in the CarbonData 2.0.1, in the type of
'SHOW SEGMENT on table {tablename} AS 'select * from tablename_segments'.
But in order to build the TEMP VIEW {tablename_segments}, it will list all
the segments and fetch the partitions info of every segment. When the number
of segments is large, the time cost is very high.
*
Solution 1:*
Parse LIMIT operations when query contains LIMIT operations. Then Only Load
the specified number of segments.
Disadvantage:
In order to support both
"show segments for table limit 10" and
"show segments on table as select * from table_segment limit 10".
Two different meaning of LIMIT operator in the 'SHOW SEGMENT'. need two
parsing flow to handle that.
Solution 2:
Add an LIMIT operater in the SHOW SEGMENT command.
SHOW [HISTORY] SEGMENTS
[FOR TABLE | ON] [db_name.]table_name* [LIMIT number_of_segments]*
[AS (select query from table_name_segments)]
--
Sent from:
http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/