{"id":19944203,"url":"https://github.com/canner/canner-udf-example","last_synced_at":"2025-05-03T16:30:49.613Z","repository":{"id":144737501,"uuid":"617278822","full_name":"Canner/canner-udf-example","owner":"Canner","description":"Canner UDF example","archived":false,"fork":false,"pushed_at":"2023-09-20T11:10:05.000Z","size":14,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-25T11:50:11.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Canner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-22T03:40:23.000Z","updated_at":"2023-09-26T09:37:44.000Z","dependencies_parsed_at":"2024-11-13T00:29:45.782Z","dependency_job_id":null,"html_url":"https://github.com/Canner/canner-udf-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canner%2Fcanner-udf-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canner%2Fcanner-udf-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canner%2Fcanner-udf-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canner%2Fcanner-udf-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Canner","download_url":"https://codeload.github.com/Canner/canner-udf-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252216038,"owners_count":21713083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T00:19:28.286Z","updated_at":"2025-05-03T16:30:49.367Z","avatar_url":"https://github.com/Canner.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# canner-udf-example\n\ncanner-udf-example provides example for writing scalar UDF in Canner.\nA scalar function is a function that returns one value per invocation; in most cases, you can think of this as returning one value per row\n\n### Example scalar functions in this project\n\n- In DataMasking.java\n\n```text\nmask_column(varchar):varchar\nmask_email(varchar,bigint):varchar\n```\n\n- In EncryptDecryptWithKey.java\n\n```text\nencrypt(varchar):varbinary\ndecrypt(varbinary):varchar\n```\n\nIn ExtendedHashFunction.java\n\n```text\nripemd_160(varchar):varchar\n```\n\n- In MathOperation.java\n\n```text\nmath_op(bigint,bigint):bigint\n```\n\n- In TimestampSeqNo.java\n\n```text\nseq_no(timestamp(p)):varchar\n```\n\n- In TimestampWithTZSeqNo.java\n\n```text\nseq_no(timestamp(p) with time zone):varchar\n```\n\n### Notices\n\n- `resources/META-INF/services/io.trino.spi.Plugin` is needed for canner to load the plugin. And the content of this file is the full class name of the plugin class. (i.e.\n  com.canner.udf.UdfPlugin in this example project)\n- Note that all udf classes (i.e. DataMasking.class, EncryptDecryptWithKey, etc.) are added in `UdfPlugin#getFunctions`. Doing this will make the udfs available in Canner.\n\n### How to build and deploy udf to canner ?\n\n- JDK Version: 11+\n- run `mvn clean package`\n- in `{project-root}/target`, you will find `udf-1.0-SNAPSHOT-jar-with-dependencies.jar` please rename this file (replace `-` with `_`) and upload it to the User-Defined Function (\n  UDF) page\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanner%2Fcanner-udf-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanner%2Fcanner-udf-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanner%2Fcanner-udf-example/lists"}