amal-v opened a new issue #10558:
URL: https://github.com/apache/druid/issues/10558


   ### Description
   While the segments are unavailable(loading), the UI tries to populate the 
datasource pages with this query and fails.
   ```
   2020-11-04T13:37:55,948 WARN [sql[ae2011e4-8731-4b9a-beaf-81513ffec9c9]] 
org.apache.druid.sql.http.SqlResource - Failed to handle query: 
SqlQuery{query='SELECT
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   datasource,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   COUNT(*) FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS 
num_segments,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   COUNT(*) FILTER 
(WHERE is_available = 1 AND ((is_published = 1 AND is_overshadowed = 0) OR 
is_realtime = 1)) AS num_available_segments,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   COUNT(*) FILTER 
(WHERE is_published = 1 AND is_overshadowed = 0 AND is_available = 0) AS 
num_segments_to_load,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   COUNT(*) FILTER 
(WHERE is_available = 1 AND NOT ((is_published = 1 AND is_overshadowed = 0) OR 
is_realtime = 1)) AS num_segments_to_drop,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   SUM("size") FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0)) AS total_data_size,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   SUM("size" * 
"num_replicas") FILTER (WHERE (is_published = 1 AND is_overshadowed = 0)) AS 
replicated_size,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   MIN("size") FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0)) AS min_segment_size,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   (
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:     SUM("size") FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0)) /
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:     COUNT(*) FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0))
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   ) AS avg_segment_size,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   MAX("size") FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0)) AS max_segment_size,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   SUM("num_rows") 
FILTER (WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS 
total_rows,
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   (
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:     SUM("size") FILTER 
(WHERE (is_published = 1 AND is_overshadowed = 0)) /
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:     SUM("num_rows") 
FILTER (WHERE (is_published = 1 AND is_overshadowed = 0))
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]:   ) AS avg_row_size
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]: FROM sys.segments
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]: GROUP BY 1', 
resultFormat=OBJECT, header=false, context={}, parameters=[]}
   Nov 04 13:37:55 ip-10-1-130-103 druid-node.sh[1986]: 
java.lang.ArithmeticException: / by zero
   ```
   The issue resolves ones all the segments are loaded.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to