Execute query
  • 17 Mar 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Execute query

  • Dark
    Light
  • PDF

Article summary

The previous article describes the controls available on the catalog page. 

  1. Select the table/view from the left side table and view the listing.
  2. Optionally, edit the query using the 'Edit query' icon.
  3. Click the 'Run Query' button to execute the query.

Query editor

The default 'Run Query' fetches catalog for 500 images/500 rows(for imported tables). Clicking on the 'Edit Query' icon opens up the following options to customize the query.

  1. Add Conditions: This expands a panel to add query conditions, as shown below.
    You can specify the query conditions by selecting the column and operation from the drop-down menus and filling values. Logical AND or OR can be used to combine multiple conditions.
  2. Add Custom Conditions: If the query condition to be specified is not present as an operation in the drop-down, then a text box is provided to specify a custom SQL WHERE condition, as shown below.
  3. Order by: By default, no order is applied to the output results. If specific ordering is required, click on the 'Order By' button and specify the columns to order by.
  4. Advanced: Opens up advanced conditions that are described in the next section.
  5. Limit: The 'Max frames' option provides a drop-down to select the maximum number of frames whose rows should be returned. This limit is capped to the number of frames defined in the plan limits corresponding to the subscription plan that is currently active.

Advanced conditions

  1. Post conditions: When an image has multiple rows of attributes, the default behavior on internal tables and views is to return all the rows corresponding to that image. For example, an image with two bounding boxes with the categories 'person' and 'car' in two rows will return both rows even if a filter condition 'category = person' matches only one row. This default behavior can be overridden using the post conditions where an additional filter on the rows of an image will be applied as per the post conditions. With 'category=person' specified as a postcondition, only the row with the 'person' bounding box will be returned.
  2. Sequence query: For video datasets, the catalog query can be specified to return a representative frame from a sequence of frames. This result can be used to create a 'Sequence Explore' job where sequences are visualized and searched instead of individual images. The 'Sequence query' has the following additional parameters.
    1. Length: Length of the sequence in seconds.
    2. Stride: Gap between successive sequences. The frames in the catalog are divided into chunks, each covering  'Stride' seconds, and only one frame matching the query conditions is chosen from a stride.
    3. Offset: Consider an event with frame X with 'category=person' ground truth. However, the sequence of interest is a 'traffic light turning green while a person is about to walk into a crosswalk. This event starts a few seconds before the frame that has 'traffic_light=green'. To support this use case, the offset specifies the number of seconds before the frame that matches the query conditions from where the sequence should be considered to start.
  3. Usage Intent:  If query results are for 'Global search', then Query(Global Search) must be selected.  This allows querying for maximum frames twice that of a regular query to enable creating a global search on a larger set of points.

Was this article helpful?

What's Next