Skip to content

Create our version of substr #1311

Open
@Vedin

Description

@Vedin

Current datafusion version of substr and substring is compatible with PostgreSQL. The main difference is treatment of negative numbers in second argument. For example:
SELECT substr('mystring', -1, 3); -> result m in PostgreSQL and datafusion
SELECT substr('mystring', -1, 3); - > result g in Snowflake.
We should create our own version of substr which follow this documentation:
https://docs.snowflake.com/en/sql-reference/functions/substr .
To complete this task we need:

  1. Follow guidelines in crates/embucket-functions/docs/function_implementation_guide.md
  2. Use the datafusion substr implementation as reference
  3. Create snapshot tests in embucket-functions/src/tests/string_binary folder.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions