You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Ali Alsuliman (JIRA)" <ji...@apache.org> on 2019/05/19 22:19:00 UTC

[jira] [Assigned] (ASTERIXDB-2531) Normalized keys are ignored for optional fields

     [ https://issues.apache.org/jira/browse/ASTERIXDB-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ali Alsuliman reassigned ASTERIXDB-2531:
----------------------------------------

    Assignee: Wail Alkowaileet  (was: Ali Alsuliman)

> Normalized keys are ignored for optional fields
> -----------------------------------------------
>
>                 Key: ASTERIXDB-2531
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2531
>             Project: Apache AsterixDB
>          Issue Type: Improvement
>          Components: COMP - Compiler, SQL - Translator SQL++
>    Affects Versions: 0.9.4
>            Reporter: Wail Alkowaileet
>            Assignee: Wail Alkowaileet
>            Priority: Major
>             Fix For: 0.9.4.2
>
>
> Normalized keys are not utilized when fields are optional.
>  
> {code:java}
> SELECT uname, a
> FROM Tweets t
> GROUP BY t.user.name AS uname WITH a AS AVG(LENGTH(text))
> ORDER BY a DESC
> LIMIT 10
> {code}
> _AVG(LENGTH(text))_ should always return NULL/MISSING or DOUBLE (despite if _text_ is open or closed). It fails if text is not a string.
> The issue is the *INormalizedKeyComputerFactory* does not know how to deal with MISSING/NULL. Supporting the normalized keys for sorting can improve the sorting time.
> We might need to extend SQL++ to specify how to sort UNKNOWABLES:
> {code:java}
> SELECT uname, a
> FROM Tweets t
> GROUP BY t.user.name AS uname WITH a AS AVG(LENGTH(text))
> ORDER BY a DESC (UNKNOWABLES (FIRST | LAST))?
> LIMIT 10
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)