hasura / hasura/graphql-engine

server: support "_like" operator for snowflake

Open
#10,088 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

a/data/snowflake c/server k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Is your proposal related to a problem?

_like operator is not available for selection in query filter for "String" data type column in case of Snowflake source. Unlike other sources like PG, MSSQL or BQ, there are no references of it anywhere explicitly in docs nor do generated GQL API for snowflake source support it when tested in practical.

Describe the solution you'd like

As other sources support it, it would be perfect if there is a support for it added in Snowflake. This way we can also close out "parity gap" between all the sources. Snowflake already supports LIKE operation as mentioned in it's docs here.

Workaround

For one-off temporary solution, we can use Native Queries.

You can prepare an SQL statement which would include usage of like, allow SQL to take input from parameters as args so you can use it in SQL statement and wrap it behind Native Query. Define a logical model for it and then set Native Query's return type to that of Logical Model, and it will be exposed as part of your GraphQL API.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing Snowflake's generated GraphQL filter operators with the equivalent support in the PostgreSQL, MSSQL, or BigQuery sources. Read the Snowflake LIKE documentation and trace where source-specific String operators are exposed and translated. Done means the _like operator is available for Snowflake String columns and is reflected in the generated GraphQL API.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.