Zoltan Ivanfi has posted comments on this change. Change subject: IMPALA-1659: Netezza compatibility functions: metadata ......................................................................
Patch Set 1: (2 comments) http://gerrit.cloudera.org:8080/#/c/4063/1/be/src/exprs/utility-functions-ir.cc File be/src/exprs/utility-functions-ir.cc: Line 120: StringVal UtilityFunctions::CurrentSid(FunctionContext* ctx) { > I agree that the function lists in the netezza compatibility JIRAs were not I agree that providing a function to query the session ID would be a useful addition. If you are fine with this implementation knowing that it will not provide any Netezza-compatility after all, I am happy to submit it as well - after all, I already wrote the code for it. ;) http://gerrit.cloudera.org:8080/#/c/4063/1/common/function-registry/impala_functions.py File common/function-registry/impala_functions.py: Line 551: [['user', 'current_user', 'current_schema'], 'STRING', [], 'impala::UtilityFunctions::User'], > current_schema is the same as the user? Since there is no universal definition of a schema, we can not provide a function that will fit everyone's definition. Based on my short research, according to IBM and Oracle, schemas seem to be conceptually similar to users (although I'm not an expert of their database products, so I may be mistaken). The document attached to the feature request also linked to IBM's page. Based on this it seems like a reasonable compromise to return the user name here. My sources in more details: netezza-functions.pdf [1], which is attached to the issue IMPALA-1660 contains the list of functions to be added with some context. Despite the name of the document, most of the functions are not Netezza functions, but are from other vendors. The info for CURRENT_SCHEMA links to an IBM page (as many other functions in that PDF), but it is a dead link. The link for CURRENT_CATALOG however, leads to another IBM page [2] that lists all functions. This page describes CURRENT_SCHEMA as "Returns the current schema name (user name)". Also a highly rated answer on Stack Overflow [3] states that in Oracle "schema == namespace within database, identical to user account" but also that "The meaning of 'catalog', 'schema' and 'database' vary from one implementation to another." [1] https://issues.cloudera.org/secure/attachment/12199/netezza-functions.pdf [2] http://www.ibm.com/support/knowledgecenter/SSULQD_7.0.3/com.ibm.nz.dbu.doc/r_dbuser_functions.html [3] http://stackoverflow.com/a/7944489/5613485 -- To view, visit http://gerrit.cloudera.org:8080/4063 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b5d1009bbf42acc175a942d2df484e1c64822ca Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zoltan Ivanfi <[email protected]> Gerrit-Reviewer: Marcel Kornacker <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Zoltan Ivanfi <[email protected]> Gerrit-HasComments: Yes
