[Discussion] Support the LIMIT operator for show segments command

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discussion] Support the LIMIT operator for show segments command

haomarch
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/
Reply | Threaded
Open this post in threaded view
|

Re: [Discussion] Support the LIMIT operator for show segments command

David CaiQiang
+1 for solution 1

but the limit statment will get the head or tail of segment list? or need
order by some columns? Please describe the details.



-----
Best Regards
David Cai
--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/
Best Regards
David Cai