On this page

    Editing Aggregation Reflections

    You might want to edit an aggregation reflection if you are iteratively designing and testing an aggregation reflection, if the definition of the view that the reflection was created from was changed, if the schema of the underlying table was changed, or if you want to revise one or more aggregations defined in the reflection.

    If you created an aggregation reflection in the Basic view of the reflections editor, you can edit that reflection either in the Basic view or in the Advanced view.

    Editing Aggregation Reflections in the Basic View of the Reflections Editor

    1. Open the reflections editor.
      See “Locations of the Reflections Editor” to find out where you can open the editor from.
    2. In the Aggregation Reflection section of the editor, modify or accept the recommendation for dimension fields and measure fields.
    3. Click Save.

    Result

    Dremio runs the job or jobs to recreate the reflection.

    Editing Aggregation Reflections in the Advanced View of the Reflections Editor

    1. Open the reflections editor.
      See “Locations of the Reflections Editor” to find out where you can open the editor from.
    2. Click the Advanced View button in the top-right corner of the editor.
    3. Click Aggregation Reflections.
    4. (Optional) Click in the name to rename the reflection.
      The purpose of the name is to help you understand, when you read job reports, which reflections the query optimizer considered and chose when planning queries.
    5. In the columns of the table, follow these steps, which you don’t have to do in any particular order:

      Note:
      Ignore the Distribution column. Selecting fields in it has no effect on the reflection.

    • Click in the Dimensions column to include or exclude fields to use as dimensions.

    • Click in the Measures field to include or exclude fields to use as measures. You can use one or more of these SQL functions for each measure: APPROX_DISTINCT_COUNT, COUNT, MAX, and MIN.

      The full list of SQL aggregation functions that Dremio supports is not supported in the reflections editor. If you want to create a reflection that aggregates data by using the sQL function AVG, CORR, HLL, SUM, VAR_POP, or VAR_SAMP, you must create a view that uses the function, and then create a raw reflection from that view.

    • Click in the Sort column to select fields on which to sort the data in the reflection. For guidance in selecting a field on which to sort, see the section “Sort Reflections on High-Cardinality Fields” in “Best Practices for Creating Raw and Aggregation Reflections”.

    • Click in the Partition column to select fields on which to horizontally partition the rows in the reflection. For guidance in selecting fields on which to partition, see the section “Horizontally Partition Reflections that Have Many Rows”.

    1. (Optional) Optimize the number of files used to store the reflection. You can optimize for fast refreshes or for fast read performance by queries. Follow these steps:

      a. Click the gear icon in the table in which you are defining the reflection.

      b. In the field Reflection execution strategy, select either of these options:

      • Options
        • Select Minimize Time Needed To Refresh if you need the reflection to be created as fast as possible. This option can result in the data for the reflection being stored in many small files. This is the default option.
        • Select Minimize Number Of Files when you want to improve read performance of queries against the reflection. With this option, there tend to be fewer seeks performed for a given query.
    2. Click Save when you are finished.

    Result

    Dremio runs the job or jobs to recreate the reflection.