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

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

Github user kaspersorensen commented on the pull request:

    https://github.com/apache/metamodel/pull/62#issuecomment-150560414
  
    The concern is that actually it's a flag you can set independently of which 
function it applies to. I have only myself used it wrt. COUNT function, but you 
could also query an approximate AVG function or something like that. This means 
that "just" adding approximate_count would not work - and it would not support 
people plugging in new functions themselves.
    
    I guess we could introduce it as a first-class keyword like DISTINCT, then 
it would be ```SELECT APPROXIMATE COUNT(*) FROM table``` instead ... Not sure I 
like that better, but it would work I guess.
    
    A word of comfort: People that expect MetaModel to use "standard SQL" would 
probably never set this flag because it is not part of any standard at all. So 
they would never encounter the tilde symbol anywhere :-)


> 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)

Reply via email to