Github user nonstop-qfchen commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/62#discussion_r37680009
--- Diff: core/sql/sqlcomp/CmpSeabaseDDLtable.cpp ---
@@ -378,6 +378,244 @@ void CmpSeabaseDDL::createSeabaseTableLike(
return;
}
+//
----------------------------------------------------------------------------
+// Method: createSeabaseTableExternalHive
+//
+// This method creates a Trafodion table that represents a Hive table
+//
+// in:
+// cliInterface - references to the cli execution structure
+// createTableNode - representation of the CREATE TABLE statement
+// currCatName - catalog name to use, if not specified
+// currSchName - schema name to use, if not specified
+//
+// returns: 0 - successful, -1 error, -2 error requiring cleanup
+//
+// any error detected is added to the diags area
+//
----------------------------------------------------------------------------
+short CmpSeabaseDDL::createSeabaseTableExternalHive(
+ ExeCliInterface &cliInterface,
+ StmtDDLCreateTable * createTableNode,
+ NAString &currCatName,
+ NAString &currSchName)
+{
+ Lng32 retcode = 0;
+
+ ComObjectName srcTableName(createTableNode->getLikeSourceTableName(),
COM_TABLE_NAME);
+ srcTableName.applyDefaults(currCatName, currSchName);
+
+ // For the target object, use TRAFODION as the default catalog and the
source
+ // table's schema name as the default schema
+ ComObjectName tgtTableName(createTableNode->getTableName(),
COM_TABLE_NAME);
+ ComAnsiNamePart currCatAnsiName(getSystemCatalog());
+ ComAnsiNamePart
currSchAnsiName(srcTableName.getSchemaNamePart().getExternalName());
+ tgtTableName.applyDefaults(currCatName, currSchAnsiName);
+
+ // For now the object and schema name for the target table must match the
+ // object and schema name for the source table
+ if (tgtTableName.getObjectNamePart().getExternalName() !=
+ srcTableName.getObjectNamePart().getExternalName())
--- End diff --
In HIVE (since 0.13), a column name can be quoted with backtick characters
(not the same as double quoted SQL identifiers), see
http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.1.5/bk_dataintegration/content/ch_using-hive-quotedidentifiers.html.
Just wonder if we are going to support that.
For the table names, we are going to only allow those with alphanumeric
plus underscore characters, right?
---
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.
---