[
https://issues.apache.org/jira/browse/TRAFODION-3152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554888#comment-16554888
]
ASF GitHub Bot commented on TRAFODION-3152:
-------------------------------------------
GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/trafodion/pull/1663
[TRAFODION-3152] Fix bug in UPDATE STATISTICS CREATE SAMPLE
If the "_HIVESTATS_" schema didn't already exist, UPDATE STATISTICS ...
CREATE SAMPLE and UPDATE STATISTICS ... REMOVE SAMPLE would fail with weird
errors.
With this change, they now will succeed. The "_HIVESTATS_" schema and
associated histogram tables will be created automatically.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/trafodion Trafodion3152
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1663.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 #1663
----
commit f79b3e5ed5924f78632f3b2815ead1281e77e66a
Author: Dave Birdsall <dbirdsall@...>
Date: 2018-07-24T23:03:20Z
[TRAFODION-3152] Fix bug in UPDATE STATISTICS CREATE SAMPLE
----
> UPDATE STATISTICS ... CREATE SAMPLE failure on Hive table
> ---------------------------------------------------------
>
> Key: TRAFODION-3152
> URL: https://issues.apache.org/jira/browse/TRAFODION-3152
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-cmp
> Reporter: David Wayne Birdsall
> Assignee: David Wayne Birdsall
> Priority: Minor
>
> On a fresh Trafodion instance where the "_HIVESTATS_" schema does not yet
> exist, if one does an UPDATE STATISTICS ... CREATE SAMPLE (or REMOVE SAMPLE)
> on a Hive table, it fails with an ugly error, as the following example shows:
> {quote}>>get schemas;
>
> Schemas in Catalog TRAFODION
> ============================
>
> SEABASE
> _LIBMGR_
> _MD_
> _PRIVMGR_MD_
> _REPOS_
>
> --- SQL operation complete.
> >>update statistics for table hive.hive.customer create sample random 10
> >>percent;
>
> *** ERROR[4082] Object TRAFODION."_HIVESTATS_".SB_PERSISTENT_SAMPLES does not
> exist or is inaccessible.
>
> *** ERROR[1003] Schema TRAFODION._HIVESTATS_ does not exist.
>
> *** ERROR[8839] Transaction was aborted.
>
> *** ERROR[9200] UPDATE STATISTICS for table HIVE.HIVE.CUSTOMER encountered an
> error (8609) from statement Process_Query.
>
> *** ERROR[8609] Waited rollback performed without starting a transaction.
>
> --- SQL operation failed with errors.
> >>update statistics for table hive.hive.customer remove sample;
>
> *** ERROR[4082] Object TRAFODION."_HIVESTATS_".SB_PERSISTENT_SAMPLES does not
> exist or is inaccessible.
>
> *** ERROR[1003] Schema TRAFODION._HIVESTATS_ does not exist.
>
> *** ERROR[8839] Transaction was aborted.
>
> *** ERROR[9200] UPDATE STATISTICS for table HIVE.HIVE.CUSTOMER encountered an
> error (8609) from statement Process_Query.
>
> *** ERROR[8609] Waited rollback performed without starting a transaction.
>
> --- SQL operation failed with errors.
> {quote}
> There is a simple work-around. Just perform a normal UPDATE STATISTICS on any
> Hive table, then Trafodion will create the "_HIVESTATS_" schema under the
> covers. Alternatively, perform a REGISTER command for any Hive table; again
> Trafodion will create "_HIVESTATS_" under the covers. The CREATE SAMPLE /
> REMOVE SAMPLE commands will now work.
> To reproduce, you need a fresh Trafodion instance (e.g. created using
> INITIALIZE TRAFODION).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)