Ramin Gharib created FLINK-41344:
------------------------------------

             Summary: Add VARIANT_CONTAINS with a shared value-equality rule
                 Key: FLINK-41344
                 URL: https://issues.apache.org/jira/browse/FLINK-41344
             Project: Flink
          Issue Type: Sub-task
          Components: Table SQL / API, Table SQL / Runtime
            Reporter: Ramin Gharib


{code:sql}
VARIANT_CONTAINS(variant, needle)   -- BOOLEAN

VARIANT_CONTAINS(v, PARSE_JSON('{"user":{"name":"ada"}}'))   -- TRUE
{code}

Scope:
* An object contains another when it has each of its keys, and each value 
contains the needle's value.
* An array contains another when each needle element is contained in some 
element, in any order.
* Scalars match by one equality rule, kept in one place so later VARIANT 
equality work can reuse it. Numbers are equal by value whatever size they are 
stored in, so a 1 in 1 byte equals a 1 in 8 bytes. Other scalars need the same 
type and value. A variant null equals only a variant null. The list of field 
names a value carries does not matter.
* SQL NULL gives NULL.
* Table API and PyFlink expressions, SQL and Table API tests, docs.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to