User with manage_statistics privilege unable to create stats for Hive table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
In Progress
|
Medium
|
Barry Fritchman |
Bug Description
Under the following circumstances, Update Statistics will fail with an error trying to create the sb_histograms table in a schema (trafodion.
1) The user is not db__root
2) The user has the manage_statistics component privilege
3) The user does NOT have the create_schema component privilege
4) There have been no previous successful attempts to update statistics on a Hive table
Without schema creating privilege, the attempt by Update Stats to create the trafodion.hivestats schema will fail without terminating execution of the statement, the assumption being that the failure was due to the schema already existing. Subsequently, the attempt to create trafodion.
The addition of the create_schema component privilege introduces the possibility of another error besides the harmless "schema already exists" error. Even though create_schema is granted to public by default, this can't be relied on, and the error needs to be checked before deciding to continue execution. This requires some changes to the general-purpose function that executes internal statements on behalf of Update Statistics. A cleaner solution would be possible if the IF NOT EXISTS clause was supported for creation of schemas, as it is for creation of tables.
Changed in trafodion: | |
importance: | Undecided → High |
status: | New → In Progress |
Changed in trafodion: | |
importance: | High → Medium |
Changed in trafodion: | |
milestone: | none → r2.0 |
tags: | added: sql-cmp |
Fix proposed to branch: master /review. trafodion. org/1194
Review: https:/