[
https://issues.apache.org/jira/browse/CALCITE-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788417#comment-16788417
]
Julian Hyde commented on CALCITE-2599:
--------------------------------------
I don't think this needs a parser change. Just add a function.
Some more tests:
* Please test with a character that is between 127 and 255. Java bytes are
signed, whereas I think this needs to return a positive value.
* Also test with a character that is above 255. That would answer [~sereda]'s
question "why not use charAt".
* Also, test with null. ASCII(null) should return null; ASCII('') should return
0.
> Support ASCII(string) in SqlFunctions
> -------------------------------------
>
> Key: CALCITE-2599
> URL: https://issues.apache.org/jira/browse/CALCITE-2599
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: TANG Wen-hui
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> {fn ASCII(string)}- Convert a single-character string to the corresponding
> ASCII code, an integer between 0 and 255
> [https://calcite.apache.org/docs/reference.html]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)