DRILL-5068: Create sys.profiles table
(Thanks to Hongze Zhang for the initial work)
Introduced a non-distributed (i.e. the foreman Drillbit executes a single fragment query) system table to list the completed profiles that are visible to it in the persistent store. This allows for querying the profiles on the following common metrics:
queryId
startTime
foreman
fragments
user
queue
planTime
queueTime
executeTime
totalTime
state
query
An additional system table - `sys.profiles_json` has also been introduced. This only has the following fields:
queryId
json
This allows for more detail metrics to be queried on the profile as a JSON document. Users are expected to use `sys.profiles` to identify profiles on the available metrics (such as long executeTime or fragments), and use the queryId to find the corresponding JSON document representation for further drill down into the profiles.
Updated TestMetadataProvider with new tally for current table and column counting tests
Security check to prevent unauthorized access to profile listing
Updated based on review comments
This closes #1077