Skip to content

Extending BinaryOp/Operator support #15326

@waynexia

Description

@waynexia

Is your feature request related to a problem or challenge?

There are some gaps between our Operator and BinaryOperator from sqlparser, where some of them are useful.

This ticket is not intended to align the gap between Operator and BinaryOperator. But to include those might-helpful operators with sqlparser as the reference. And further implement some of them (which means leaving another part just a placeholder, and even not included).

We can categorize our current Operators into three parts: fully supported (like AND/OR), included but not supported (like @>) and not included. This ticket focuses on extending the first two parts. And for some operators, it may take a relatively long time to fully support them. Like those for JSON operation. The meaning of listing them here is for rough progress tracking, and to push them into the "included but not implemented" stage for downstream projects to easily extend their version.

Describe the solution you'd like

Here is a table of various operators and their status:

Operator Description Status Tickets
Arrow (PG) -> extracts a JSON object field or array element Included But Not Implemented #15327,
LongArrow (PG) ->> extracts a JSON object field or JSON array element and converts it to text Included But Not Implemented #15327,
HashArrow (PG) #> extracts a JSON sub-object at the specified path Included But Not Implemented #15327,
HashLongArrow (PG) #>> extracts JSON sub-object at the specified path Included But Not Implemented #15327,
ArrowAt (PG) <@ is used for JSON and text searches 🚧 Available for array, not implemented for structs and text #6885, #15327,
AtArrow (PG) @> is used for JSON and text searches 🚧 Available for array, not implemented for structs and text #6885, #15327,
AtAt (PG) @@ is used for JSON and text searches Included But Not Implemented #15327,
XOR a XOR b. We've implemented BitwiseXor and can map this to BitwiseXor operator ✅ map to BitwiseXor #15327
DIV or // (MySQL/DuckDB) Integer division. Not Included
ALL SELECT 1 = ALL(ARRAY[1,1,1,1]); Unparsed
Question (PG) ? checks whether a string exists as a top-level key within the JSON value Included But Not Implemented #15327,
AtQuestion (PG) @? checks the given JSON path returns an item for the JSON value Included But Not Implemented #15327,
QuestionAnd (PG) ?& check whether all of the the indicated array members exist as top-level keys Included But Not Implemented #15327,
QuestionPipe (PG) ? checks whether any of the the indicated array members exist as top-level keys Included But Not Implemented #15327,

Feel free to add or modify it

Describe alternatives you've considered

No response

Additional context

Cross-references:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions