You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/11/28 19:50:00 UTC

[jira] [Commented] (CALCITE-5385) Add BigQuery as supported library for implemented functions

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

Julian Hyde commented on CALCITE-5385:
--------------------------------------

[~tanclary], I think "Add a few existing functions to BigQuery library" would be a better summary / commit message.

In {{SqlLibraryOperators.java}},
{code:java}
@LibraryOperator(libraries = {ORACLE, POSTGRESQL, BIG_QUERY}) {code}
should be
{code:java}
@LibraryOperator(libraries = {BIG_QUERY, ORACLE, POSTGRESQL}) {code}
(Like a lot of first-time contributors, you modestly put your stuff last. But the list should be sorted. Putting it in any other order may cause merge errors in future.)

In {{SqlOperatorTest}}, I like how you have used a lambda to run the same test for multiple libraries. But I think it could be improved further. In {{SqlOperatorFixture}}, if you add a method {{public default void forEachLibrary(Iterable<? extends SqlLibrary>, Consumer<SqlLibrary>)}} I think you can use it in these tests. (Tests that loop are an anti-pattern because if it fails on one particular loop iteration, you can't tell which entry was at fault. With the {{forEachLibrary} method I suggested, at least you could add a {{catch}} block to identify the library.)

Please add a commit to the PR (do not squash/amend/rebase) and ping me when it's ready for re-review.

> Add BigQuery as supported library for implemented functions
> -----------------------------------------------------------
>
>                 Key: CALCITE-5385
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5385
>             Project: Calcite
>          Issue Type: Task
>            Reporter: Tanner Clary
>            Assignee: Tanner Clary
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Add BigQuery as a supported library for functions that have already been implemented for other libraries. This ticket overrides Calcite-5384 to include other functions that need BQ added as a supported library.
> List of functions:
>  * MD5()
>  * SHA1()
>  * GREATEST()
>  * LEAST()
>  * COSH()
>  * SINH()
>  * TANH()
>  * FROM_BASE64()
>  * LEFT()
>  * LTRIM()
>  * REPEAT()
>  * REVERSE()
>  * RIGHT()
>  * RTRIM()
>  * SOUNDEX()
>  * TRANSLATE()



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