You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by liuyu000 <gi...@git.apache.org> on 2017/04/26 05:21:25 UTC

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

GitHub user liuyu000 opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1073

    [TRAFODION-2550] update sql reference manual about metadata clean up command

    Changes proposed in this pull request: 
    Add "CLEANUP Statement".

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/liuyu000/incubator-trafodion clean

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1073.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1073
    
----
commit c502f8374dfe81e97cded8215ae1f551066b68f0
Author: liu.yu <yu...@esgyn.cn>
Date:   2017-04-26T04:19:04Z

    add cleanup statement

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113882680
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Thanks Dave.
    Yes, the {project-name} appears many times as a variable for Trafodion in .adoc files.
    But here I'm afraid, the usage of curly brace, is also appropriate, as the Notation Conventions defined in the _Trafodion SQL Manaul_:
    > { } Braces
    Braces enclose **required syntax items**.
    ...
    A group of items enclosed in braces is a list from which you are required to choose one item.
    
    Here is an example of the syntax of GRANT Statement in the .adoc file and on the website:
    ``
    GRANT {privilege [,privilege]... |ALL [PRIVILEGES]}
    ``
    ``
    ON [object-type] [schema.]object
    ``
    `` 
    TO {grantee}
    ``
    ``
    [WITH GRANT OPTION]
    ``
    ``
    [[GRANTED] BY grantor]
    ``
    
    As for this statement, `obj-type` and `obj-name` are required syntax items. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r114157711
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    OK. Thanks for checking this out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r114243955
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Thanks Dave.
    
    Could I change to:
    `CLEANUP object-type object-name [ , UID {object-uid} ]` 
    ?
    
    If so, the syntax of GRANT Statement should be changed to:
    `....`
    `TO grantee`
    `...`
    
    (delete the curly braces around `grantee` since just one choice?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113556852
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    The syntax elements obj-type, obj-name and so on should not have curly braces around them. Curly braces indicate to the document formatter that this is a variable to be replace by other text. You'll see {project-name} here and there for exapmle. That gets replaced by the string 'Trafodion'. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113731513
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    +
    +CLEANUP [ PRIVATE | SHARED ] SCHEMA {schema-name}
    +
    +CLEANUP UID {object-uid}
    +
    +CLEANUP METADATA [ , CHECK ] [ , RETURN DETAILS ]
    +```
    +
    +```
    +{obj-type} is: TABLE | INDEX | SEQUENCE | OBJECT
    +
    +{obj-name} is: Name of the object that needs to be cleaned up
    +
    +{object-uid} is: UID (Unique ID) of the object that is stored in metadata
    +
    +{schema-name} is: Name of the schema whose contents need to be cleaned up
    +```
    +
    +[[cleanup_syntax]]
    +=== Syntax Description of CLEANUP Statement
    +
    +* `CLEANUP {obj-type} {obj-name} [ , UID {object-uid} ]`
    ++
    +This command will clean up the specified object from all Trafodion metadata tables
    +and HBase. If an object cannot be found in the metadata but exists in HBase,
    +then it will be removed from HBase. All dependent objects, such as indexes,
    +views, LOBs, internal sequences, and constraints, are also removed from the
    +metadata and HBase.
    +
    +** `obj-type` 
    +
    +*** If an object type is specified as TABLE, INDEX, or SEQUENCE and that object exists
    +in the metadata, then a check will be done to make sure that the specified {obj-name} is of the specified type. An error is returned if they are not the same.
    +
    +*** If an object type is specified as OBJECT, then any object that matches the
    +specified name is removed from the metadata and HBase.
    +
    +** `obj-name` 
    ++
    +Specifies the name of the object to be removed.
    +
    +** `object-uid` 
    ++
    +If an object exists in the OBJECTS metadata table, then the stored object UID is compared with the specified object UID. If they do not match, then cleanup is not done. If an object does not exist in the OBJECTS metadata table, then all entries matching the specified object UID are removed from the metadata tables.
    +
    +* `CLEANUP [ PRIVATE | SHARED ] SCHEMA {schema-name}`
    ++
    +This command will clean up all objects that are created in the specified schema.
    +
    +* `CLEANUP UID {object-uid}`
    ++
    +This command will remove all entries from all metadata tables that match the specified object UID. If the specified object UID exists in the OBJECTS metadata table and the object name associated with that UID can be retrieved, then that object is also removed from HBase.
    +
    +* `CLEANUP METADATA [ , CHECK ] [ , RETURN DETAILS ]`
    ++
    +This command will look for inconsistent entries in the metadata, return information about them, and clean them up. Multiple checks are done to validate metadata consistency.
    +
    +** `CHECK`
    ++
    +One can check for inconsistent metadata entries without actually cleaning them up.
    +This can be done by specifying the `CHECK` option. If `CHECK` is specified, the following checks will be performed simultaneously, and a summary of inconsistent objects belonging to the categories listed below will be returned.
    +
    +*** Orphan Metadata Objects
    ++
    +This check is done to validate that objects that exist in metadata also exist in HBase. If the object does not exist in HBase, then it is marked as an orphan metadata object.
    +
    +*** Orphan HBase Objects
    ++
    +This check is done to validate that objects that exist in HBase also exist in metadata. If the object does not exist in metadata, then it is marked as an orphan HBase object.
    +
    +*** Inconsistent Object Entries
    ++
    +This check is done to make sure that all entries in the OBJECTS table also exist in
    +the OBJECTS unique index (OBJECTS_UNIQ_IDX) and that all entries in OBJECTS_UNIQ_IDX also exist in the OBJECTS table. It also checks to make sure that all entries in the COLUMNS table have a corresponding entry in the OBJECTS table. If any of the previous checks fail, then that entry is marked as inconsistent.
    +
    +*** Inconsistent View Entries
    ++
    +This check is done to make sure that all view entries are consistent among the views and the OBJECTS table.
    +
    +** `RETURN DETAILS`
    ++
    +If `RETURN DETAILS` is specified, then details on which objects are inconsistent is also returned.
    +
    +<<<
    +[[cleanup_considerations]]
    +=== Considerations for CLEANUP Statement
    +
    +[[security_and_privileges]]
    +==== Security and Privileges
    +
    +To clean up an object, one needs to have DROP privileges. If object privileges cannot be retrieved from the metadata or if metadata cleanup is being done, then one needs to be DB_ROOT to perform the cleanup.
    +
    +[[consistency_checks_during_access]]
    +==== Consistency Checks During Access
    +
    +If an object exists in the metadata but does not exist in HBase, then error 4254 will be returned if that object is accessed during any DML or DDL operation.
    +
    +An object is also marked as inconsistent during any complex DDL operation. For example, if a CREATE TABLE also creates implicit indexes or constraints, then the object will be marked as inconsistent until the complex DDL operation is completed. If an abnormal error happens (like a process crash or a node failure), then that object remains inconsistent. Any attempt to access that object will return error 4254.
    --- End diff --
    
    "(like a process crash...)"  Wordsmith nit. "(such as a process crash...)" is a bit better because here you are citing process crashes and node failures as examples of errors, rather than characterizing all errors to be similar to process crashes or node failures, which is what "like" implies.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113885649
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Thanks Dave. :)
    But I'm afraid `RETURN DETAILS` is not supported here.
    Ming helped me perform a test using the sqlci, it returned a syntax error, then we checked the parser/sqlparser.y and found that `RETURN DETAILS is not yet supported` , details are as below (circled in red):
    ![return details is not yet suported](https://cloud.githubusercontent.com/assets/20532956/25522260/d5e8d2b6-2c34-11e7-98ed-47999b765936.PNG)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/1073


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r114157674
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    I should have been more clear.
    
    The Trafodion SQL Manual describes the case where there are multiple syntax items, where you must choose one. Notice in the GRANT example you mention that one has to supply either a list of privileges or the keywords "ALL [ PRIVILEGES ]". But in the CLEANUP example, there is just one choice, not multiple choices. I suppose one could argue that { a } means I have to choose a, but then so does specifying "a" by itself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113730462
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Reading parser/sqlparser.y, it looks like [ , RETURN DETAILS ] is supported for CLEANUP obj-type obj-name  as well but oddly not when [ , UID object-uid ] is present. So perhaps modify this to CLEANUP obj-type obj-name [ , UID object-uid | , RETURN DETAILS ] ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r114467023
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Got, thanks Dave. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r114350002
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    --- End diff --
    
    Yes, I agree.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1073: [TRAFODION-2550] update sql referenc...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1073#discussion_r113885805
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc ---
    @@ -48,6 +49,326 @@ to connect to and issue SQL utilities, see the
     {docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_].
     
     <<<
    +[[cleanup_statement]]
    +== CLEANUP Statement
    +
    +The CLEANUP Statement cleans up objects whose information is inconsistent in the metadata. This command can be used to clean up individual objects or all objects in a schema. This command can also be used to locate all inconsistent objects in the Trafodion metadata and then clean them up.
    +
    +Inconsistent objects can be cleaned up and removed from the metadata and HBase by using one of the following options.
    +
    +```
    +CLEANUP {obj-type} {obj-name} [ ,UID {object-uid} ]
    +
    +CLEANUP [ PRIVATE | SHARED ] SCHEMA {schema-name}
    +
    +CLEANUP UID {object-uid}
    +
    +CLEANUP METADATA [ , CHECK ] [ , RETURN DETAILS ]
    +```
    +
    +```
    +{obj-type} is: TABLE | INDEX | SEQUENCE | OBJECT
    +
    +{obj-name} is: Name of the object that needs to be cleaned up
    +
    +{object-uid} is: UID (Unique ID) of the object that is stored in metadata
    +
    +{schema-name} is: Name of the schema whose contents need to be cleaned up
    +```
    +
    +[[cleanup_syntax]]
    +=== Syntax Description of CLEANUP Statement
    +
    +* `CLEANUP {obj-type} {obj-name} [ , UID {object-uid} ]`
    ++
    +This command will clean up the specified object from all Trafodion metadata tables
    +and HBase. If an object cannot be found in the metadata but exists in HBase,
    +then it will be removed from HBase. All dependent objects, such as indexes,
    +views, LOBs, internal sequences, and constraints, are also removed from the
    +metadata and HBase.
    +
    +** `obj-type` 
    +
    +*** If an object type is specified as TABLE, INDEX, or SEQUENCE and that object exists
    +in the metadata, then a check will be done to make sure that the specified {obj-name} is of the specified type. An error is returned if they are not the same.
    +
    +*** If an object type is specified as OBJECT, then any object that matches the
    +specified name is removed from the metadata and HBase.
    +
    +** `obj-name` 
    ++
    +Specifies the name of the object to be removed.
    +
    +** `object-uid` 
    ++
    +If an object exists in the OBJECTS metadata table, then the stored object UID is compared with the specified object UID. If they do not match, then cleanup is not done. If an object does not exist in the OBJECTS metadata table, then all entries matching the specified object UID are removed from the metadata tables.
    +
    +* `CLEANUP [ PRIVATE | SHARED ] SCHEMA {schema-name}`
    ++
    +This command will clean up all objects that are created in the specified schema.
    +
    +* `CLEANUP UID {object-uid}`
    ++
    +This command will remove all entries from all metadata tables that match the specified object UID. If the specified object UID exists in the OBJECTS metadata table and the object name associated with that UID can be retrieved, then that object is also removed from HBase.
    +
    +* `CLEANUP METADATA [ , CHECK ] [ , RETURN DETAILS ]`
    ++
    +This command will look for inconsistent entries in the metadata, return information about them, and clean them up. Multiple checks are done to validate metadata consistency.
    +
    +** `CHECK`
    ++
    +One can check for inconsistent metadata entries without actually cleaning them up.
    +This can be done by specifying the `CHECK` option. If `CHECK` is specified, the following checks will be performed simultaneously, and a summary of inconsistent objects belonging to the categories listed below will be returned.
    +
    +*** Orphan Metadata Objects
    ++
    +This check is done to validate that objects that exist in metadata also exist in HBase. If the object does not exist in HBase, then it is marked as an orphan metadata object.
    +
    +*** Orphan HBase Objects
    ++
    +This check is done to validate that objects that exist in HBase also exist in metadata. If the object does not exist in metadata, then it is marked as an orphan HBase object.
    +
    +*** Inconsistent Object Entries
    ++
    +This check is done to make sure that all entries in the OBJECTS table also exist in
    +the OBJECTS unique index (OBJECTS_UNIQ_IDX) and that all entries in OBJECTS_UNIQ_IDX also exist in the OBJECTS table. It also checks to make sure that all entries in the COLUMNS table have a corresponding entry in the OBJECTS table. If any of the previous checks fail, then that entry is marked as inconsistent.
    +
    +*** Inconsistent View Entries
    ++
    +This check is done to make sure that all view entries are consistent among the views and the OBJECTS table.
    +
    +** `RETURN DETAILS`
    ++
    +If `RETURN DETAILS` is specified, then details on which objects are inconsistent is also returned.
    +
    +<<<
    +[[cleanup_considerations]]
    +=== Considerations for CLEANUP Statement
    +
    +[[security_and_privileges]]
    +==== Security and Privileges
    +
    +To clean up an object, one needs to have DROP privileges. If object privileges cannot be retrieved from the metadata or if metadata cleanup is being done, then one needs to be DB_ROOT to perform the cleanup.
    +
    +[[consistency_checks_during_access]]
    +==== Consistency Checks During Access
    +
    +If an object exists in the metadata but does not exist in HBase, then error 4254 will be returned if that object is accessed during any DML or DDL operation.
    +
    +An object is also marked as inconsistent during any complex DDL operation. For example, if a CREATE TABLE also creates implicit indexes or constraints, then the object will be marked as inconsistent until the complex DDL operation is completed. If an abnormal error happens (like a process crash or a node failure), then that object remains inconsistent. Any attempt to access that object will return error 4254.
    --- End diff --
    
    Thanks Dave.
    Your comments has been incorporated. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---