[ 
https://issues.apache.org/jira/browse/CALCITE-6172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17799597#comment-17799597
 ] 

Julian Hyde commented on CALCITE-6172:
--------------------------------------

One particular test is {{SqlOperatorTest.java}}. In CALCITE-6156, which added 
{{STARTSWITH}} as an alias for {{STARTS_WITH}}, about 25 lines were added which 
were copy-pasted tests.

Functions that are aliases, according to {{StandardConvertletTable.java}}:
* {{ENDSWITH}}, {{ENDS_WITH}} - see CALCITE-6156
* {{STARTSWITH}}, {{STARTS_WITH}} - CALCITE-6156
* {{NVL}}, {{IFNULL}} - see CALCITE-5430
* {{<=>}}, {{IS NOT DISTINCT FROM}} - see CALCITE-5430
* {{IS UNKNOWN}}, {{IS NULL}}
* {{IS NOT UNKNOWN}}, {{IS NOT NULL}}
* {{LENGTH}}, {{CHAR_LENGTH}}, {{CHARACTER_LENGTH}} - see CALCITE-5452
* {{REGEXP_SUBSTR}}, {{REGEXP_EXTRACT}} - see CALCITE-5910

The goal is not to write zero tests - that way we would not notice if the alias 
stopped working - but to reuse the majority of tests.

> Allow aliased operators to re-use existing tests
> ------------------------------------------------
>
>                 Key: CALCITE-6172
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6172
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Tanner Clary
>            Assignee: Tanner Clary
>            Priority: Major
>
> Currently, for operators that have multiple names (potentially across 
> multiple libraries), there is no convenient way to re-use tests other than 
> just copy and pasting. To avoid redundancy and potential discrepancies, it 
> would be helpful if the same set of tests could be used for each alias.
> I'll modify this case once I have some ideas.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to