salt clause on a table with large number of primary key columns returns error

Bug #1385543 reported by Anoop Sharma
6
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.
>>

Tags: sql-cmu
Revision history for this message
Anoop Sharma (anoop-sharma) wrote :

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.

Changed in trafodion:
assignee: Anoop Sharma (anoop-sharma) → Hans Zeller (hans-zeller)
Revision history for this message
Hans Zeller (hans-zeller) wrote :

Now that Anoop added a subtype to the TEXT table, we can easily store the computed column text in the TEXT table. The fix will be compatible with the old code, if we don't find the computed column definition in the TEXT table we will look in the default value in the COLUMNS table.

Changed in trafodion:
status: New → In Progress
milestone: none → r1.0
Revision history for this message
Hans Zeller (hans-zeller) wrote :
Changed in trafodion:
status: In Progress → Fix Committed
Paul Low (paul-low-x)
Changed in trafodion:
milestone: r1.0 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.