[
https://issues.apache.org/jira/browse/TRAFODION-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545715#comment-16545715
]
ASF GitHub Bot commented on TRAFODION-3148:
-------------------------------------------
GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/trafodion/pull/1649
[TRAFODION-3148] Fix UPDATE STATS bug on Hive tables w/ column _DIVISION_1_
This fixes a bug concerning sample tables created by UPDATE STATISTICS on
Hive tables.
When a Hive table had a column named "_DIVISION_1_" (or any other reserved
Trafodion column name), the UPDATE STATISTICS command would fail if a sample
table needed to be created. The failure would occur because we would not
include "_DIVISION_1_" etc. in the select list of the UPSERT/SELECT statement
used to populate the sample table.
This has been fixed.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/trafodion Trafodion3148
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1649.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 #1649
----
commit d3945fe7973cd001b3b5268e53b4d1117f45d54f
Author: Dave Birdsall <dbirdsall@...>
Date: 2018-07-16T20:41:21Z
[TRAFODION-3148] Fix UPDATE STATS bug on Hive tables w/ column _DIVISION_1_
----
> Creating a persistent sample table on a Hive table fails with some columns
> --------------------------------------------------------------------------
>
> Key: TRAFODION-3148
> URL: https://issues.apache.org/jira/browse/TRAFODION-3148
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-cmp
> Affects Versions: 2.3
> Reporter: David Wayne Birdsall
> Assignee: David Wayne Birdsall
> Priority: Major
>
> The following reproduces the problem.
> First, create and populate a Hive table that uses the column name
> "__DIVISION_1__". (In Hive, one uses backticks to define delimited column
> names rather than double quotes as in standard SQL.):
> {{hive> create table dave2( a int, `__DIVISION_1__` int)}}
> > stored as textfile
> > ;
> {{OK}}
> {{Time taken: 0.122 seconds}}
> {{hive> insert into dave2 values (1,2),(3,4),(5,6),(7,8);}}
> Then, in Trafodion sqlci, attempt to create a random sample. This will fail:
> {{>>update statistics for table hive.hive.dave2 create sample random 90
> percent;}}
> {{*** ERROR[9200] UPDATE STATISTICS for table HIVE.HIVE.DAVE2 encountered an
> error (4023) from statement Process_Query.}}
> {{*** ERROR[4023] The degree of each row value constructor (1) must equal the
> degree of the target table column list (2).}}
> {{*** ERROR[8822] The statement was not prepared.}}{{--- SQL operation failed
> with errors.}}
> {{>>}}
> The probable cause of the problem is that "__DIVISION_1__" is assumed in
> Trafodion to be a derived column, but this assumption is incorrect for Hive
> tables.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)