Youwei Wang has posted comments on this change. Change subject: IMPALA-889: Add support for ISO-SQL trim() ......................................................................
Patch Set 3: (4 comments) http://gerrit.cloudera.org:8080/#/c/3213/3/be/src/exprs/string-functions-ir.cc File be/src/exprs/string-functions-ir.cc: Line 732: ctx->GetFunctionState(FunctionContext::THREAD_LOCAL)); > Please use functions, not macros Done Line 790: enum class TRIM_OPTION > Does the rest of our code use ALL_CAPS for enum types? Hi Jim. According the definition of "enum ExprConstant" in the expr.h file: enum ExprConstant { RETURN_TYPE_SIZE, // int RETURN_TYPE_PRECISION, // int RETURN_TYPE_SCALE, // int ARG_TYPE_SIZE, // int[] ARG_TYPE_PRECISION, // int[] ARG_TYPE_SCALE, // int[] }; I think "enum class TrimOption" may be a proper choice. Thanks. Line 798: if (memcmp(reinterpret_cast<const char*>(option.ptr), "left", 4) == 0) { > This does the wrong thing if option.ptr is "leftZZZ" Done http://gerrit.cloudera.org:8080/#/c/3213/3/be/src/exprs/string-functions.h File be/src/exprs/string-functions.h: Line 103: /// Similar to BTrimString with extra direction 'option', which has three choices: > You must document what happens if it is NULL or otherwise incorrect. Done -- To view, visit http://gerrit.cloudera.org:8080/3213 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4753c608b0b00569bf8c5e95b132df6df358e602 Gerrit-PatchSet: 3 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Youwei Wang <[email protected]> Gerrit-Reviewer: Jim Apple <[email protected]> Gerrit-Reviewer: Youwei Wang <[email protected]> Gerrit-HasComments: Yes
