David Wayne Birdsall created TRAFODION-2440:
-----------------------------------------------

             Summary: Accessing a Hive table with long names results in error 
8436
                 Key: TRAFODION-2440
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2440
             Project: Apache Trafodion
          Issue Type: Bug
          Components: -exe, sql-exe
    Affects Versions: 2.1-incubating
            Reporter: David Wayne Birdsall
            Assignee: David Wayne Birdsall


If we use a long Hive database name and a long Hive table name, attempts to 
select from that table from Trafodion fail with SQL error 8436.

Example: Use the following hive script to create a table via the Hive shell:

drop database if exists
Trafodion2434abcdabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
cascade;

create database
Trafodion2434abcdabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

use
Trafodion2434abcdabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

drop table if exists 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789;

create table 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
(
Column01 int,
Column02 string
) clustered by (Column01) sorted by (Column01) into 4 buckets row format 
delimited fields terminated by '|';

insert into 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
values
(1,'one');
        
insert into 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
values
(2,'two');

insert into 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
values
(3,'three');

insert into 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
values
(4,'four');

select * from
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

exit;

Next, do the following in sqlci:

control query default HIVE_MAX_STRING_LENGTH '10';

set schema 
hive.Trafodion2434abcdabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

showddl 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

select * from 
ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
;

This will fail as follows:

>>control query default HIVE_MAX_STRING_LENGTH '10';

--- SQL operation complete.
>>
>>set schema 
>>hive.Trafodion2434abcdabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
+>;

--- SQL operation complete.
>>
>>showddl 
>>ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
+>;

/* Hive DDL */
CREATE TABLE 
PROBLEMTABLESTR1ABCDEFABCDEFGHIJABCDEFGHIJ01234567890123456789012345678901234567890123456789012345678901234567890123456789
  (
    COLUMN01                         int
  , COLUMN02                         string
  )
  stored as textfile
;

--- SQL operation complete.
>>
>>select * from 
>>ProblemTableSTR1abcdefabcdefghijabcdefghij01234567890123456789012345678901234567890123456789012345678901234567890123456789
+>;

*** ERROR[8436] Mismatch detected between compiletime and runtime hive table 
definitions. DataModMismatchDetails:

--- 0 row(s) selected.
>>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to