You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by "Zhu, Wen-Jun" <we...@esgyn.cn> on 2018/03/05 07:07:55 UTC

problem when adding a new metadata table in Trafodion

Hi,

I am try to store some info in metadata, and I find the TEXT table is not enough. So I'd like to add another metadata table.

So I add a item in allMDtablesInfo in file CmpSeabaseDDLmd.h, in alphabetical order(is the order necessary?), just like other metadata table.
That's ALL change I have done.

Then I reinitialize the trafodion with statement initialize trafodion, and I get the following message:

SQL error [X01BW]: *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
  *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
    *** ERROR[4082] Object TRAFODION."_MD_".OBJECTS does not exist or is inaccessible. [2018-03-05 09:37:19]
*** ERROR[8822] The statement was not prepared. [2018-03-05 09:37:19]

And the error occurs in CmpSeabaseDDL::getSeabaseTableDesc:

    #1  0x00007f164c0693fa in CmpSeabaseDDL::getSeabaseTableDesc (this=0x7f161f51b3e0, catName=..., schName=..., objName=..., objType=COM_BASE_TABLE_OBJECT, includeInvalidDefs=0) at ../sqlcomp/CmpSeabaseDDLtable.cpp:14338
    #2  0x00007f164a19f2f4 in NATableDB::get (this=0x7f161e92e5b8, corrName=..., bindWA=0x7f161f51efc0, inTableDescStruct=0x0) at ../optimizer/NATable.cpp:9193
    #3  0x00007f1649eb8e42 in BindWA::getNATable (this=0x7f161f51efc0, corrName=..., catmanCollectTableUsages=1, inTableDescStruct=0x0) at ../optimizer/BindRelExp    r.cpp:1563
    #4  0x00007f1649ed2f2d in Scan::bindNode (this=0x7f1618a7a478, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:7840
    #5  0x00007f1649ebcea5 in RelExpr::bindChildren (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:2446
    #6  0x00007f1649eca804 in RelRoot::bindNode (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:5743
#7  0x00007f164bf625c7 in CmpMain::compile (this=0x7f161f521980, input_str=0x7f161e989478 "select object_uid, object_owner, schema_owner, flags, create_time from TRAFODION.\"_MD_\".OBJECTS where catalog_name = 'TRAFODION' and schema_name = '_REPOS_' and object_name = 'METRIC_QUERY_AGGR_TABLE'"..., charset=15, queryExpr=@0x7f161f521868, gen_code=0x7f1618a77300, gen_code_len=0x7f1618a772f8, heap=0x7f161eabf840, phase=CmpMain::END, fragmentDir=0x7f161f521ad0, op=3004, useQueryCache=CmpMain::NORMAL, cacheable=0x7f161f521854, begTime=0x7f161f521870, shouldLog=0) at ../sqlcomp/CmpMain.cpp:2140

The objName in stack frmae 1 is OBJECTS.

As the info shows, it sees that there is something wrong with the OBJECTS table, which has nothing to do with the newly add one.
Can anyone figure out what is wrong?

Is this related to old metadata tables, and do I have the change the SEABASE_xxx_OLD_MD accordingly?

Thanks

Regards,
Wenjun Zhu

RE: problem when adding a new metadata table in Trafodion

Posted by Anoop Sharma <an...@esgyn.com>.
change to metadata tables require version change and MD upgrade.
It needs to be done carefully and in a coordinated way as MD upgrades
are only done for major releases. 

As Roberta mentioned, why is TEXT table not sufficient? What kind of
metadata changes are being added?

In addition to CmpSeabaseDDLmd.h, you also need to modify CmpSeabaseDDLupgrade.h
which contain steps on how to add/delete/change metadata. There are comments in
the beginning of that file listing those steps.

anoop

-----Original Message-----
From: Roberta Marton <ro...@esgyn.com> 
Sent: Monday, March 5, 2018 7:49 AM
To: dev@trafodion.apache.org
Subject: RE: problem when adding a new metadata table in Trafodion

Why isn't the TEXT table sufficient?  There is a sequence number associated with the row so you can add multiple rows for the same entry.  There is code to split the data into several rows as part of insert and code to put the rows together in a single field when reading the data.

    Roberta

-----Original Message-----
From: Zhu, Wen-Jun [mailto:wenjun.zhu@esgyn.cn] 
Sent: Sunday, March 4, 2018 11:08 PM
To: dev@trafodion.apache.org
Subject: problem when adding a new metadata table in Trafodion

Hi,

I am try to store some info in metadata, and I find the TEXT table is not enough. So I'd like to add another metadata table.

So I add a item in allMDtablesInfo in file CmpSeabaseDDLmd.h, in alphabetical order(is the order necessary?), just like other metadata table.
That's ALL change I have done.

Then I reinitialize the trafodion with statement initialize trafodion, and I get the following message:

SQL error [X01BW]: *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
  *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
    *** ERROR[4082] Object TRAFODION."_MD_".OBJECTS does not exist or is inaccessible. [2018-03-05 09:37:19]
*** ERROR[8822] The statement was not prepared. [2018-03-05 09:37:19]

And the error occurs in CmpSeabaseDDL::getSeabaseTableDesc:

    #1  0x00007f164c0693fa in CmpSeabaseDDL::getSeabaseTableDesc (this=0x7f161f51b3e0, catName=..., schName=..., objName=..., objType=COM_BASE_TABLE_OBJECT, includeInvalidDefs=0) at ../sqlcomp/CmpSeabaseDDLtable.cpp:14338
    #2  0x00007f164a19f2f4 in NATableDB::get (this=0x7f161e92e5b8, corrName=..., bindWA=0x7f161f51efc0, inTableDescStruct=0x0) at ../optimizer/NATable.cpp:9193
    #3  0x00007f1649eb8e42 in BindWA::getNATable (this=0x7f161f51efc0, corrName=..., catmanCollectTableUsages=1, inTableDescStruct=0x0) at ../optimizer/BindRelExp    r.cpp:1563
    #4  0x00007f1649ed2f2d in Scan::bindNode (this=0x7f1618a7a478, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:7840
    #5  0x00007f1649ebcea5 in RelExpr::bindChildren (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:2446
    #6  0x00007f1649eca804 in RelRoot::bindNode (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:5743
#7  0x00007f164bf625c7 in CmpMain::compile (this=0x7f161f521980, input_str=0x7f161e989478 "select object_uid, object_owner, schema_owner, flags, create_time from TRAFODION.\"_MD_\".OBJECTS where catalog_name = 'TRAFODION' and schema_name = '_REPOS_' and object_name = 'METRIC_QUERY_AGGR_TABLE'"..., charset=15, queryExpr=@0x7f161f521868, gen_code=0x7f1618a77300, gen_code_len=0x7f1618a772f8, heap=0x7f161eabf840, phase=CmpMain::END, fragmentDir=0x7f161f521ad0, op=3004, useQueryCache=CmpMain::NORMAL, cacheable=0x7f161f521854, begTime=0x7f161f521870, shouldLog=0) at ../sqlcomp/CmpMain.cpp:2140

The objName in stack frmae 1 is OBJECTS.

As the info shows, it sees that there is something wrong with the OBJECTS table, which has nothing to do with the newly add one.
Can anyone figure out what is wrong?

Is this related to old metadata tables, and do I have the change the SEABASE_xxx_OLD_MD accordingly?

Thanks

Regards,
Wenjun Zhu

RE: problem when adding a new metadata table in Trafodion

Posted by Roberta Marton <ro...@esgyn.com>.
Why isn't the TEXT table sufficient?  There is a sequence number associated with the row so you can add multiple rows for the same entry.  There is code to split the data into several rows as part of insert and code to put the rows together in a single field when reading the data.

    Roberta

-----Original Message-----
From: Zhu, Wen-Jun [mailto:wenjun.zhu@esgyn.cn] 
Sent: Sunday, March 4, 2018 11:08 PM
To: dev@trafodion.apache.org
Subject: problem when adding a new metadata table in Trafodion

Hi,

I am try to store some info in metadata, and I find the TEXT table is not enough. So I'd like to add another metadata table.

So I add a item in allMDtablesInfo in file CmpSeabaseDDLmd.h, in alphabetical order(is the order necessary?), just like other metadata table.
That's ALL change I have done.

Then I reinitialize the trafodion with statement initialize trafodion, and I get the following message:

SQL error [X01BW]: *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
  *** ERROR[1428] Metadata definitions could not be created and preloaded in global MDdescInfo struct. Make sure that metadata table definition syntax is correct. [2018-03-05 09:37:19]
    *** ERROR[4082] Object TRAFODION."_MD_".OBJECTS does not exist or is inaccessible. [2018-03-05 09:37:19]
*** ERROR[8822] The statement was not prepared. [2018-03-05 09:37:19]

And the error occurs in CmpSeabaseDDL::getSeabaseTableDesc:

    #1  0x00007f164c0693fa in CmpSeabaseDDL::getSeabaseTableDesc (this=0x7f161f51b3e0, catName=..., schName=..., objName=..., objType=COM_BASE_TABLE_OBJECT, includeInvalidDefs=0) at ../sqlcomp/CmpSeabaseDDLtable.cpp:14338
    #2  0x00007f164a19f2f4 in NATableDB::get (this=0x7f161e92e5b8, corrName=..., bindWA=0x7f161f51efc0, inTableDescStruct=0x0) at ../optimizer/NATable.cpp:9193
    #3  0x00007f1649eb8e42 in BindWA::getNATable (this=0x7f161f51efc0, corrName=..., catmanCollectTableUsages=1, inTableDescStruct=0x0) at ../optimizer/BindRelExp    r.cpp:1563
    #4  0x00007f1649ed2f2d in Scan::bindNode (this=0x7f1618a7a478, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:7840
    #5  0x00007f1649ebcea5 in RelExpr::bindChildren (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:2446
    #6  0x00007f1649eca804 in RelRoot::bindNode (this=0x7f1618a877f0, bindWA=0x7f161f51efc0) at ../optimizer/BindRelExpr.cpp:5743
#7  0x00007f164bf625c7 in CmpMain::compile (this=0x7f161f521980, input_str=0x7f161e989478 "select object_uid, object_owner, schema_owner, flags, create_time from TRAFODION.\"_MD_\".OBJECTS where catalog_name = 'TRAFODION' and schema_name = '_REPOS_' and object_name = 'METRIC_QUERY_AGGR_TABLE'"..., charset=15, queryExpr=@0x7f161f521868, gen_code=0x7f1618a77300, gen_code_len=0x7f1618a772f8, heap=0x7f161eabf840, phase=CmpMain::END, fragmentDir=0x7f161f521ad0, op=3004, useQueryCache=CmpMain::NORMAL, cacheable=0x7f161f521854, begTime=0x7f161f521870, shouldLog=0) at ../sqlcomp/CmpMain.cpp:2140

The objName in stack frmae 1 is OBJECTS.

As the info shows, it sees that there is something wrong with the OBJECTS table, which has nothing to do with the newly add one.
Can anyone figure out what is wrong?

Is this related to old metadata tables, and do I have the change the SEABASE_xxx_OLD_MD accordingly?

Thanks

Regards,
Wenjun Zhu