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

Oliver Lee edited comment on CALCITE-5389 at 11/23/22 8:11 PM:
---------------------------------------------------------------

I have some questions on how we should handle {{BYTES}}

Context: BIG_QUERY documentation says it should support `STRING` as well as 
`BYTES` for input

 

Issue: Running a query like
 {{SELECT STARTS_WITH(b'123', b'1');}}  
gives me a parser exception 
{{ParseException: Encountered "\'123\'"}}, unable to parse byte literals.

I've tried casting a string as BYTES with 
{{SELECT CAST("12" as BYTES) ;}}
  and that returns
 {{Unknown identifier 'BYTES' -> SqlValidatorException: Unknown identifier 
'BYTES'}}

 

I see in Calcite that we do acknowledge the BYTES/ VARBINARY aliasing 
[https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql/SqlAlienSystemTypeNameSpec.java#L30]

 

 

Question: Could I follow through with this current PR and file a new ticket 
detailing that BIG_QUERY BYTES is not fully functioning? 


was (Author: JIRAUSER297744):
I have some questions on how we should handle `BYTES`

Context: BIG_QUERY documentation says it should support `STRING` as well as 
`BYTES` for input

 

Issue: Running a query like `SELECT STARTS_WITH(b'123', b'1');` gives me a 
parser exception `ParseException: Encountered "\'123\'"`, unable to parse byte 
literals.

I've tried casting a string as BYTES with `SELECT CAST("12" as BYTES) ;`  and 
that returns `Unknown identifier 'BYTES' -> SqlValidatorException: Unknown 
identifier 'BYTES'`

 

I see in Calcite that we do acknowledge the BYTES/ VARBINARY aliasing 
[https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql/SqlAlienSystemTypeNameSpec.java#L30]

 

 

Question: Could I follow through with this current PR and file a new ticket 
detailing that BIG_QUERY BYTES is not fully functioning? 

> STARTS_WITH for BIG_QUERY
> -------------------------
>
>                 Key: CALCITE-5389
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5389
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Oliver Lee
>            Assignee: Oliver Lee
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Adding support for STARTS_WITH for BIG_QUERY dialect



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to