[
https://issues.apache.org/jira/browse/CALCITE-5729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17729617#comment-17729617
]
Dan Zou edited comment on CALCITE-5729 at 6/12/23 3:01 AM:
-----------------------------------------------------------
[~julianhyde] Thanks for the information. After I checked the ANSI SQL
standard, I came to two conclusions:
1. The input parameters for 'OCTET_LENGTH' could be string or binary, but we
only support binary for now.
2. 'BYTE_LENGTH' is the same with 'OCTET_LENGTH'.
{code:java}
<octet length expression> ::=
OCTET_LENGTH <left paren> <string value expression> <right paren>
<string value expression> ::=
<character value expression>
| <binary value expression>
{code}
So maybe we could support binary as the input for 'OCTET_LENGTH' in a separate
jira and then add 'BYTE_LENGTH' as an alias for 'OCTET_LENGTH', WDYT?
was (Author: frankzou):
[~julianhyde] Thanks for the information. After I checked the ANSI SQL
standard, I came to two conclusions:
1. The input parameters for 'OCTET_LENGTH' coule be string or binary, but we
only support binary for now.
2. 'BYTE_LENGTH' is the same with 'OCTET_LENGTH'.
{code:java}
<octet length expression> ::=
OCTET_LENGTH <left paren> <string value expression> <right paren>
<string value expression> ::=
<character value expression>
| <binary value expression>
{code}
So maybe we could support binary as the input for 'OCTET_LENGTH' in a separate
jira and then add 'BYTE_LENGTH' as an alias for 'OCTET_LENGTH', WDYT?
> Add BYTE_LENGTH function (enabled in BigQuery library)
> ------------------------------------------------------
>
> Key: CALCITE-5729
> URL: https://issues.apache.org/jira/browse/CALCITE-5729
> Project: Calcite
> Issue Type: New Feature
> Reporter: Dan Zou
> Assignee: Dan Zou
> Priority: Major
>
> BYTE_LENGTH(value): Returns the length of the STRING or BYTES value in BYTES,
> regardless of whether the type of the value is STRING or BYTES.
> For more details:
> [BYTE_LENGTH|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#byte_length]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)