[jira] [Commented] (CALCITE-4014) calcite convert(column using utf8mb4) throws exception

2020-05-28 Thread groobyming (Jira)


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

groobyming commented on CALCITE-4014:
-

Thanks [~julianhyde]

> calcite convert(column using utf8mb4) throws exception
> --
>
> Key: CALCITE-4014
> URL: https://issues.apache.org/jira/browse/CALCITE-4014
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.21.0
>Reporter: groobyming
>Priority: Major
> Attachments: image-2020-05-20-17-00-28-611.png
>
>
>     Hello everyone, I found that when performing the following sql 
> verification, I will be prompted that the UTF8MB4 field cannot be found in 
> the table, but after reading the source code calcite is built-in to support 
> this convert function, is it not fully implemented yet?
>  
> SQL is as follows:
> select convert(name using utf8mb4) from test b where name = '4'
>  
> Error Message:
>    !image-2020-05-20-17-00-28-611.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4014) calcite convert(column using utf8mb4) throws exception

2020-05-26 Thread Julian Hyde (Jira)


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

Julian Hyde commented on CALCITE-4014:
--

Yes, we support {{CONVERT}} in the parser (see 
{{SqlParserTest.testConvertAndTranslate}}) but not in the validator (where this 
error is happening - validating an identifier as if it is an expression, not a 
character set) or downstream (note that {{SqlOperatorBaseTest.testConvertFunc}} 
is empty).

Contributions welcome!

> calcite convert(column using utf8mb4) throws exception
> --
>
> Key: CALCITE-4014
> URL: https://issues.apache.org/jira/browse/CALCITE-4014
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.21.0
>Reporter: groobyming
>Priority: Major
> Attachments: image-2020-05-20-17-00-28-611.png
>
>
>     Hello everyone, I found that when performing the following sql 
> verification, I will be prompted that the UTF8MB4 field cannot be found in 
> the table, but after reading the source code calcite is built-in to support 
> this convert function, is it not fully implemented yet?
>  
> SQL is as follows:
> select convert(name using utf8mb4) from test b where name = '4'
>  
> Error Message:
>    !image-2020-05-20-17-00-28-611.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4014) calcite convert(column using utf8mb4) throws exception

2020-05-22 Thread groobyming (Jira)


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

groobyming commented on CALCITE-4014:
-

Thanks [~danny0405] :)

> calcite convert(column using utf8mb4) throws exception
> --
>
> Key: CALCITE-4014
> URL: https://issues.apache.org/jira/browse/CALCITE-4014
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.21.0
>Reporter: groobyming
>Priority: Major
> Attachments: image-2020-05-20-17-00-28-611.png
>
>
>     Hello everyone, I found that when performing the following sql 
> verification, I will be prompted that the UTF8MB4 field cannot be found in 
> the table, but after reading the source code calcite is built-in to support 
> this convert function, is it not fully implemented yet?
>  
> SQL is as follows:
> select convert(name using utf8mb4) from test b where name = '4'
>  
> Error Message:
>    !image-2020-05-20-17-00-28-611.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4014) calcite convert(column using utf8mb4) throws exception

2020-05-20 Thread Danny Chen (Jira)


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

Danny Chen commented on CALCITE-4014:
-

Thanks, [~groobyming] for reporting this ~

I saw the syntax we support from the parser:
```sql
 { s = span(); }

e = Expression(ExprContext.ACCEPT_SUB_QUERY) {
args = startList(e);
}
 name = SimpleIdentifier() {
args.add(name);
}
 {
return SqlStdOperatorTable.CONVERT.createCall(s.end(this), args);
}
```
That means we did support CONVERT( ... USING ...) clause. But you are right, we 
do not translate the charSet correctly, there needs more effort in the convert 
table [1], we need to translate the charSet as a constant instead of a column 
name.

[1] 
https://github.com/apache/calcite/blob/05376d6bff11ccef690addb4f9c40ab16dd20bec/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java#L103

> calcite convert(column using utf8mb4) throws exception
> --
>
> Key: CALCITE-4014
> URL: https://issues.apache.org/jira/browse/CALCITE-4014
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.21.0
>Reporter: groobyming
>Priority: Major
> Attachments: image-2020-05-20-17-00-28-611.png
>
>
>     Hello everyone, I found that when performing the following sql 
> verification, I will be prompted that the UTF8MB4 field cannot be found in 
> the table, but after reading the source code calcite is built-in to support 
> this convert function, is it not fully implemented yet?
>  
> SQL is as follows:
> select convert(name using utf8mb4) from test b where name = '4'
>  
> Error Message:
>    !image-2020-05-20-17-00-28-611.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)