[
https://issues.apache.org/jira/browse/ASTERIXDB-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17944622#comment-17944622
]
ASF subversion and git services commented on ASTERIXDB-3584:
------------------------------------------------------------
Commit 097be30bc83097ac0d7505bd4f63aa25bd809815 in asterixdb's branch
refs/heads/master from Ali Alsuliman
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=097be30bc8 ]
[ASTERIXDB-3584][FUN] Return false for '=' and '!=' when comparing incompatible
types
- user model changes: yes
- storage format changes: no
- interface changes: no
Details:
When comparing incompatible types:
For '=' and '!=', return false.
For '>', '>=', '<', and '<=', return NULL (to maintain the negation truth).
- make inequality comparison undefined for arrays similar to records and
multisets.
- update MIN, MAX tests cases on array field now that inequality for arrays
returns NULL.
Ext-ref: MB-64106
Change-Id: I9dc1f1b51609204c2d1c985c9ae3a01103f92cf9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19537
Integration-Tests: Jenkins <[email protected]>
Tested-by: Ali Alsuliman <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>
Reviewed-by: Murtadha Hubail <[email protected]>
> '!=' and '=' returns unexpected result when comparison happens across
> incompatible types
> ----------------------------------------------------------------------------------------
>
> Key: ASTERIXDB-3584
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-3584
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: FUN - Functions
> Reporter: Ali Alsuliman
> Assignee: Ali Alsuliman
> Priority: Major
> Labels: triaged
>
> The '!=' and '=' operators returns unexpected result when comparison happens
> across incompatible types. For example,
> {code:java}
> // the below returns empty result.
> SELECT * FROM [2] AS t
> WHERE t NOT IN [1,"str",3];
> SELECT * FROM ["str"] AS t
> WHERE t != 4;{code}
> This is because the comparison “str” != 4 returns NULL which is converted to
> “false”.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)