gianm commented on a change in pull request #6094: Introduce SystemSchema 
tables (#5989)
URL: https://github.com/apache/incubator-druid/pull/6094#discussion_r209744738
 
 

 ##########
 File path: docs/content/querying/sql.md
 ##########
 @@ -481,6 +485,77 @@ SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE 
TABLE_SCHEMA = 'druid' AND TABLE_
 |COLLATION_NAME||
 |JDBC_TYPE|Type code from java.sql.Types (Druid extension)|
 
+## SYSTEM SCHEMA
+
+SYSTEM_TABLES provide visibility into the druid segments, servers and tasks.
+For example to retrieve all segments for datasource "wikipedia", use the query:
+```sql
+select * from SYS.SEGMENTS where DATASOURCE='wikipedia';
+```
+
+### SEGMENTS table
+Segments tables provides details on all the segments, both published and 
served(but not published).
+
+
+|Column|Notes|
+|------|-----|
+|SEGMENT_ID||
+|DATASOURCE||
+|START||
+|END||
+|IS_PUBLISHED|segment in metadata store|
+|IS_AVAILABLE|segment is being served|
+|IS_REALTIME|segment served on a realtime server|
+|PAYLOAD|jsonified datasegment payload|
+
+### SERVERS table
+
+
+|Column|Notes|
+|------|-----|
+|SERVER||
+|SERVER_TYPE||
+|TIER||
+|CURRENT_SIZE||
+|MAX_SIZE||
+
+To retrieve all servers information, use the query
+```sql
+select * from SYS.SERVERS;
+```
+
+### SEGMENTSERVERS table
+
+SEGMENTSERVERS is used to join SEGMENTS with SERVERS table
+
+|Column|Notes|
+|------|-----|
+|SERVER||
+|SEGMENT_ID||
+
+### TASKS table
+
+TASKS table provides tasks info from overlord.
+
+|Column|Notes|
+|------|-----|
+|TASK_ID||
 
 Review comment:
   These should all have comments too.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to