salt clause on a table with large number of primary key columns returns error
Bug #1385543 reported by
Anoop Sharma
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
Medium
|
Hans Zeller |
Bug Description
This create statement with 8 column pkey returns error.
>> CREATE TABLE "O"."C1"
+> ( "OM_REGION" VARCHAR2(20) NOT NULL,
+> "OM_SYSTEM" VARCHAR2(20) DEFAULT '*' NOT NULL,
+> "SALES" VARCHAR2(20) DEFAULT '*' NOT NULL ,
+> "RTM" VARCHAR2(20) DEFAULT '*' NOT NULL,
+> "BT" VARCHAR2(20) DEFAULT '*' NOT NULL,
+> "SEG" VARCHAR2(20) DEFAULT '*' NOT NULL,
+> "SUB" VARCHAR2(20) DEFAULT '*' NOT NULL,
+> PRIMARY KEY ("OM_REGION", "OM_SYSTEM", "SALES", "RTM", "BT", "SEG", "SUB"))
+> salt using 8 partitions;
*** ERROR[1197] The salt column list (implicit or explicit) is too long.
--- SQL operation failed with errors.
>>
Changed in trafodion: | |
assignee: | Anoop Sharma (anoop-sharma) → Hans Zeller (hans-zeller) |
Changed in trafodion: | |
milestone: | r1.0 → none |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
for a salted key, a hash2partfunc expr is generated to evaluate the salt value.
That expression adds all key columns with a fully qualified cast function. This expr
text is stored in the default_value field
of columns table which has a max length of 512. If length of this expr is greater
than 500 bytes, this error is returned.
For this example, the hash2partfunc length is 544 bytes which exceeds the max allowed
for default_value column:
data_ = 0x2394d18 "HASH2PARTFUNC( CAST(OM_ REGION AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST( OM_SYSTEM AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST(SALES AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST(RTM AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST(BT AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST(SEG AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL),CAST(SUB AS VARCHAR(20) CHARACTER SET ISO88591 COLLATE DEFAULT NOT NULL) FOR 8)",
size_ = 544,
Solution to this issue is to store the partfunc expr text in TEXT table instead
of in defaultValue field of COLUMNS table. And then retrieve it from there during
table descriptor generation.