You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/10/23 12:52:27 UTC

[jira] [Commented] (METAMODEL-200) No syntax available in SQL representation of Query for "function approximation"

    [ https://issues.apache.org/jira/browse/METAMODEL-200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14970807#comment-14970807 ] 

ASF GitHub Bot commented on METAMODEL-200:
------------------------------------------

GitHub user kaspersorensen opened a pull request:

    https://github.com/apache/metamodel/pull/62

    METAMODEL-200: Added query syntax support for "function approximation"

    Fixes METAMODEL-200 by adding both toSql() and parser support for the tilde-character as a prefix "approximation indicator" for function names.
    
    I also improved a few places in SelectItem.java where function.toString() was used instead of function.getFunctionName() (there's currently no difference because they all delegate toString() to getFunctionName(), but that should only be an implementation detail).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kaspersorensen/metamodel METAMODEL-200/syntax-for-function-approximation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metamodel/pull/62.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #62
    
----
commit 04aa1b79dabac56e1f74f98b24bcaf1f0fed29c2
Author: Kasper Sørensen <i....@gmail.com>
Date:   2015-10-23T10:39:38Z

    METAMODEL-200: Added query syntax support for "function approximation"

----


> No syntax available in SQL representation of Query for "function approximation"
> -------------------------------------------------------------------------------
>
>                 Key: METAMODEL-200
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-200
>             Project: Apache MetaModel
>          Issue Type: Bug
>            Reporter: Kasper Sørensen
>
> In MetaModel we have a flag that can be set on e.g. "COUNT( * )" which indicates if the database may approximate the number instead of doing a consistent calculation. This is good for optimization scenarios where you don't need an actual count, just an estimate (for progress bars and similar stuff in UIs).
> But unfortunately we don't have any syntax support for this when dealing with String queries. Shouldn't we add that?
> I could imagine a prefix or something like that, e.g. the "tilde / ~" symbol, like this:
> {code}
> SELECT ~COUNT(*) FROM table
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)