Repository: incubator-trafodion Updated Branches: refs/heads/master 749537783 -> fbd88e49c
[TRAFODION-2838] Add error check to NATableDB::get Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9d0f8a30 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9d0f8a30 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9d0f8a30 Branch: refs/heads/master Commit: 9d0f8a30e1dcfd217026cbccdd129524eda4442e Parents: 1ce089a Author: Dave Birdsall <[email protected]> Authored: Tue Dec 12 19:51:06 2017 +0000 Committer: Dave Birdsall <[email protected]> Committed: Tue Dec 12 19:51:06 2017 +0000 ---------------------------------------------------------------------- core/sql/optimizer/NATable.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9d0f8a30/core/sql/optimizer/NATable.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp index 5f80d4e..93b649a 100644 --- a/core/sql/optimizer/NATable.cpp +++ b/core/sql/optimizer/NATable.cpp @@ -8394,8 +8394,11 @@ NATable * NATableDB::get(CorrName& corrName, BindWA * bindWA, // 'table' is the NATable for underlying hive table. // That table may also have an associated external table. // Skip processing the external table defn, if only the - // underlying hive table is needed. - if (NOT bindWA->returnHiveTableDefn()) + // underlying hive table is needed. Skip processing also + // if there were errors creating the NATable object + // (which is indicated by a getColumnCount() value of 0). + if ((NOT bindWA->returnHiveTableDefn()) && + (table->getColumnCount() > 0) ) { // if this hive/orc table has an associated external table, // get table desc for it.
