calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirav Patel <npa...@xactlycorp.com>
Subject How to parse sql expression to obtain field names
Date Thu, 18 Jan 2018 21:44:40 GMT
Is it possible to just parse sql function expression which is not a
complete sql syntax.
e.g. I want to parse expression `SUM(t1.amount)/COUNT(t1)` instead of whole
sql like "select t1.name, SUM(t1.amount)/COUNT(t1) from mytable t1 group by
t1.name". I tried

    val parser = SqlParser.create("SUM(t1.amount)/COUNT(t1)")
    val sqlNode = parser.parseExpression()

but it fails with parse exception.

Thanks

-- 


[image: What's New with Xactly] <http://www.xactlycorp.com/email-click/>

<https://www.instagram.com/xactlycorp/>   
<https://www.linkedin.com/company/xactly-corporation>   
<https://twitter.com/Xactly>   <https://www.facebook.com/XactlyCorp>   
<http://www.youtube.com/xactlycorporation>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message