Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/218#discussion_r47157318
--- Diff: core/sql/optimizer/RelRoutine.cpp ---
@@ -1081,33 +1085,37 @@ NARoutine *
PredefinedTableMappingFunction::getRoutineMetadata(
BindWA *bindWA)
{
NARoutine *result = NULL;
+ ComRoutineLanguage lang = COM_LANGUAGE_CPP;
+ ComRoutineParamStyle paramStyle = COM_STYLE_CPP_OBJ;
+ const char *externalName = NULL;
+ // By default, predefined UDRs share a DLL.
+ const char *libraryFileName = "libudr_predef.so";
NAString libraryPath;
// the libraries for predefined UDRs are in the regular
// library directory $MY_SQROOT/export/lib${SQ_MBTYPE}
libraryPath += getenv("MY_SQROOT");
libraryPath += "/export/lib";
- libraryPath += getenv("SQ_MBTYPE");
switch (getOperatorType())
{
case REL_TABLE_MAPPING_BUILTIN_LOG_READER:
+ externalName = "TRAF_CPP_EVENT_LOG_READER";
+ libraryPath += getenv("SQ_MBTYPE");
+ break;
+
case REL_TABLE_MAPPING_BUILTIN_TIMESERIES:
- {
- // produce a very simple NARoutine, most of the
- // error checking and determination of output
- // columns is done by the compiler interface of
- // this predefined table mapping function
- result = new(bindWA->wHeap()) NARoutine(routineName,
- bindWA->wHeap());
- if (getOperatorType() == REL_TABLE_MAPPING_BUILTIN_LOG_READER)
- result->setExternalName("TRAF_CPP_EVENT_LOG_READER");
- else
- result->setExternalName("TRAF_CPP_TIMESERIES");
- result->setLanguage(COM_LANGUAGE_CPP);
- result->setRoutineType(COM_TABLE_UDF_TYPE);
- result->setParamStyle(COM_STYLE_CPP_OBJ);
- }
+ externalName = "TRAF_CPP_TIMESERIES";
+ libraryPath += getenv("SQ_MBTYPE");
+ break;
+
+ case REL_TABLE_MAPPING_BUILTIN_JDBC:
+ lang = COM_LANGUAGE_JAVA;
+ paramStyle = COM_STYLE_JAVA_OBJ;
+ externalName = "org.trafodion.sql.udr.predef.JDBCUDR";
+ libraryPath += "/trafodion-sql-";
--- End diff --
Why do we add a slash for libraryPath in this case but not in the previous
two cases? (Is there something different about slashes for C++ and Java?)
---
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.
---