[
https://issues.apache.org/jira/browse/CALCITE-5978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767342#comment-17767342
]
Julian Hyde commented on CALCITE-5978:
--------------------------------------
[~jerin_john], A few late review comments. You don't need to fix them, but
please bear them in mind in future changes.
I noticed that your GitHub user name varies from one commit to the next. Can
you settle on one. For open source work, I tend to prefer that people use their
real name, then it's easier to tie to emails, Jira conversations, etc.
You have a helper functions called \{{checkPosOccurrenceParamValues}}, which
returns {{{}boolean{}}}, and anther function
\{{checkMultipleCapturingGroupsInRegex}} which returns {{{}void{}}}. The
boolean one should probably have a more descriptive name, otherwise the caller
could forget to check the return. Its javadoc should probably begin 'Returns
whether...' because that is its main purpose.
I think 'Helper function' is rarely a useful description in javadoc unless the
function is trivial. (A function with 4 {{if}} statements, each of which throws
a different exception, is not trivial.) Better to describe what it does.
The helper functions could, and therefore should, be {{{}static{}}}.
> Add REGEXP_INSTR function (enabled in BigQuery library)
> -------------------------------------------------------
>
> Key: CALCITE-5978
> URL: https://issues.apache.org/jira/browse/CALCITE-5978
> Project: Calcite
> Issue Type: Task
> Reporter: Jerin John
> Assignee: Jerin John
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.36.0
>
>
> Add support for [REGEXP_INSTR
> |https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_instr]
> function from BigQuery.
> *{{REGEXP_INSTR(string, regexp [, position [, occurrence [,
> occurrence_position]]])}}*
> Returns the lowest 1-based position of the substring in {{string}} that
> matches the {{{}regexp{}}}, Returns 0 if there is no match
> * If {{position}} is specified, the search starts at this position in
> {{{}string{}}}, otherwise it starts at the beginning of {{{}string{}}}.
> * If {{occurrence}} is specified, the search returns index for the specific
> occurrence of the {{regexp}} in value, otherwise returns the first match.
> * If {{occurrence_position}} is specified as 1, returns the end index of
> substring + 1 (default 0 returns start index of match)
> Example:
> {{SELECT REGEXP_INSTR("abcadcabcaecghi", "adc") as result;}}
> |result|
> |4|
--
This message was sent by Atlassian Jira
(v8.20.10#820010)