[
https://issues.apache.org/jira/browse/TRAFODION-2762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16190321#comment-16190321
]
ASF GitHub Bot commented on TRAFODION-2762:
-------------------------------------------
GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1255
[TRAFODION-2762] Allow UPDATE STATS to create sample tables regardless
This change causes UPDATE STATISTICS to always set CQD
ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT 'ON' and CQD CONTROL QUERY DEFAULT
CAT_ERROR_ON_NOTNULL_STOREBY 'OFF'.
This allows UPDATE STATISTICS to create a sample table with a nullable
primary key (the first CQD) or a nullable STORE BY (the second CQD). In this
way, the user does not need to remember to set these CQDs when doing UPDATE
STATISTICS on a table that was created with either of these experimental
features.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/incubator-trafodion
nullableKeyUstatBug
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1255.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 #1255
----
commit 2f49cda944da82ff8cc411b324d1000b8b9795d0
Author: Dave Birdsall <[email protected]>
Date: 2017-10-03T20:38:39Z
[TRAFODION-2762] Allow UPDATE STATS to create sample tables regardless of
CQD
----
> UPDATE STATS fails when creating sample table with nullable key
> ---------------------------------------------------------------
>
> Key: TRAFODION-2762
> URL: https://issues.apache.org/jira/browse/TRAFODION-2762
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-cmp
> Affects Versions: 2.3-incubating
> Environment: All
> Reporter: David Wayne Birdsall
> Assignee: David Wayne Birdsall
> Priority: Minor
>
> Trafodion contains an experimental feature that optionally allows one to
> create a table with a nullable primary key. That is, NULL values can be used
> in the primary key. For purposes of uniqueness, NULL is treated like any
> other value.
> One can turn on this feature via CQD ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT
> 'ON'.
> However, if one creates a table with a nullable primary key, then later in
> another session without this CQD attempts to do UPDATE STATISTICS where a
> sample table is created, UPDATE STATISTICS will fail. For example:
> update statistics for table Traf2762 on every column sample;
> *** ERROR[9214] Object
> TRAFODION.SEABASE.TRAF_SAMPLE_05267662795492559847_1505757284_535476 could
> not be created.
> *** ERROR[1135] Clustering key column inputuid must be assigned a NOT NULL
> NOT DROPPABLE constraint.
> *** ERROR[8839] Transaction was aborted.
> *** ERROR[9201] Unable to DROP object
> TRAFODION.SEABASE.TRAF_SAMPLE_05267662795492559847_15057572 84_535476.
> *** ERROR[1389] Object
> TRAFODION.SEABASE.TRAF_SAMPLE_05267662795492559847_1505757284_535476 does not
> exist in Trafodion.
> *** ERROR[8839] Transaction was aborted.
> Note: This example assumes that Traf2762 is a large enough table that a
> sample table is required by UPDATE STATISTICS.
> A more reliable way to reproduce the error (which does not depend on table
> size) is "update statistics for table Traf2762 create sample random 10
> percent".
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)