3.4 Query modelScuba provides three query interfaces, as illustrated on the rightin Figure 2.• The web-based interface shown in Figure 1 allows users toissue form-based queries and choose one of about a dozen visualizations, including tables, time series graphs, pie charts,stacked area graphs, and many more. Figures 4, 5, and 6show three more of these visualizations. Switching betweenvisualizations takes only seconds.• The command line interface accepts queries in SQL.1Archival data is not stored in Scuba. Facebook uses other, diskbased, systems for long-term retention.• The Thrift-based API allows queries from application codein PHP, C++, Java, Python, Javascript, and other languages.The SQL interface and GUI themselves use the Thrift interface tosend queries to Scuba’s backend. Scripts can also issue queriesusing either the SQL or Thrift interfaces. Finally, we provide amechanism to execute user-defined functions written in Javascript.Scuba queries have the expressive power of the following SQLquery:SELECT column, column, ...,aggregate(column), aggregate(column), ...FROM tableWHERE time >= min-timestampAND time <= max-timestamp[AND condition ...]GROUP BY column, column, ...ORDER BY aggregate(column)LIMIT numberThe aggregate functions supported include the traditional count,min, max, sum, and average functions, as well as other usefulfunctions such as sum/minute, percentiles, and histograms. TheWHERE clause must contain a time range, although other conditions are optional. The LIMIT clause defaults to 100,000 rows toavoid memory issues in grouping and rendering problems at theclient. The GROUP BY and ORDER BY clauses are wholly optional.Any comparison to a string may include a regular expression.Conditions on sets of strings are set-column includes any/all/noneof string-list and set-column is empty. Conditions on vectors ofstrings are vector-column includes any/all/none/start/end/within ofstring-list. The order of strings in the string-list is significant.Joins are not supported in Scuba. When combining data frommultiple sources is necessary, joining is usually done before importing the data into Scuba.
การแปล กรุณารอสักครู่..
