There may be cases where user defined logic needs to be executed between the compilation and execution phases of a query. One simple example that we ran into is based on archival. If an external utility archives table partitions of example, then a plugin logic can check that for the partitions and take suitable action such as:
- Unarchiving the partition seemlessly
- Throwing an error
This same framework can also be used for updating query compilation stats.