Github user robertamarton commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/62#discussion_r37805251
--- Diff: core/sql/optimizer/BindRelExpr.cpp ---
@@ -1571,6 +1569,21 @@ NATable *BindWA::getNATable(CorrName& corrName,
((QualifiedName&)(table->getTableName())).setIsVolatile(TRUE);
}
+ // For now, do not allow access through the Trafodion external name
created for
+ // the HIVE object unless the inDDL flag is set. inDDL is set for drop
+ // table and SHOWDDL statements.
+ // TDB - may want to merge the Trafodion version with the HIVE version.
+ // TDB - similar operation may be needed for external HBase tables
+ if ((table) && (table->isExternalTable() && (! bindWA->inDDL())))
--- End diff --
Create table like <external table> does create a regular table correctly -
a table with the same signature as the external table and the new table is not
external. However, we do allow it to be created in the _HV_ schema. So a
check is needed in create code to not allow objects created in schema beginning
with "_HV_" and "_HB_".
create external table like external table does not work because the source
and target tables have to be the same names. The error returned is a unique
constraint violation so a better error would be nice. If we ever allow the
external name to be different than the hive table, then we should allow this
option.
I also notice an incorrect error returned when creating an external table
with the "select as" clause. This should be fixed.
create external table promotion as select * from hive.hive.promotion;
*** ERROR[4258] Trying to access external table
TRAFODION."_HV_HIVE_".PROMOTION through its external name format. Please use
the native table name.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---