[CALCITE-3539] Implement INSTR function#1946
[CALCITE-3539] Implement INSTR function#1946xy2953396112 wants to merge 1 commit intoapache:masterfrom
Conversation
|
Do we also need to update reference.md ? |
8efc738 to
9406c0a
Compare
Thanks, i have updated reference.md. |
| tester1.checkString("INSTR('foobarbar', 'bar')", "4", "INTEGER NOT NULL"); | ||
| tester1.checkString("INSTR('bar', 'foobarbar')", "0", "INTEGER NOT NULL"); | ||
| tester1.checkNull("INSTR('foobarbar', cast(null as varchar(1)))"); | ||
| tester1.checkNull("INSTR(cast(null as varchar(1)), 'foobarbar')"); |
There was a problem hiding this comment.
Could you also add negative tests?
site/_docs/reference.md
Outdated
| | m | SPACE(integer) | Returns a string of *integer* spaces; returns an empty string if *integer* is less than 1 | ||
| | o | SUBSTR(string, position [, substringLength ]) | Returns a portion of *string*, beginning at character *position*, *substringLength* characters long. SUBSTR calculates lengths using characters as defined by the input character set | ||
| | m | STRCMP(string, string) | Returns 0 if both of the strings are same and returns -1 when the first argument is smaller than the second and 1 when the second one is smaller the first one. | ||
| | m | INSTR(string, string) | Returns the index of the first occurrence of the second argument in the first argument and returns 0 if the first argument not include the second argument. |
There was a problem hiding this comment.
We'd better remove the period at the end of the description.
There was a problem hiding this comment.
well, STRCMP does the same, change it altogether
|
MySQL's document says: ' |
site/_docs/reference.md
Outdated
| | m | SPACE(integer) | Returns a string of *integer* spaces; returns an empty string if *integer* is less than 1 | ||
| | o | SUBSTR(string, position [, substringLength ]) | Returns a portion of *string*, beginning at character *position*, *substringLength* characters long. SUBSTR calculates lengths using characters as defined by the input character set | ||
| | m | STRCMP(string, string) | Returns 0 if both of the strings are same and returns -1 when the first argument is smaller than the second and 1 when the second one is smaller the first one. | ||
| | m | INSTR(string, string) | Returns the index of the first occurrence of the second argument in the first argument and returns 0 if the first argument not include the second argument. |
There was a problem hiding this comment.
Please move the description here and sort by alphabet.
|
hi @xy2953396112 There is an error in the title here, it should be the link https://issues.apache.org/jira/browse/CALCITE-3959 |
9406c0a to
20d8309
Compare
20d8309 to
3f1a38b
Compare
|
looks good overall |
No description provided.