coral icon indicating copy to clipboard operation
coral copied to clipboard

org.apache.calcite.runtime.CalciteException: Failed to encode '中文' in character set 'ISO-8859-1'

Open guozhihua12 opened this issue 3 years ago • 5 comments

public void testTable() { String sql = "select b, '中文' from test.t2 where b = a"; RelNode relNode = TestUtils.convertTable(sql); RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(); SqlNode expandedSql = relToTrinoConverter.convertToSqlNode(relNode); System.out.println(expandedSql); }

guozhihua12 avatar Sep 11 '21 09:09 guozhihua12

image

guozhihua12 avatar Sep 11 '21 09:09 guozhihua12

Looks like it is an issue of the upstream calcite: https://issues.apache.org/jira/browse/CALCITE-3308, https://issues.apache.org/jira/browse/CALCITE-2616 it would be kind of hard to fix in Coral.

ljfgem avatar Sep 11 '21 19:09 ljfgem

Looks like it is an issue of the upstream calcite: https://issues.apache.org/jira/browse/CALCITE-3308, https://issues.apache.org/jira/browse/CALCITE-2616 it would be kind of hard to fix in Coral.

I agree, do you want to change org.apache.calcite.Util#DEFAULT_CHARSET or org.apache.calcite.rel.type.RelDataTypeFactoryImpl#getDefaultCharset?

JiajunBernoulli avatar Sep 15 '21 09:09 JiajunBernoulli

You can import the configuration file( saffron.properties) of calcite and set calcite.default.charset=utf8,this solves the problem.

huangxiaopingRD avatar Sep 17 '21 08:09 huangxiaopingRD

You can import the configuration file( saffron.properties) of calcite and set calcite.default.charset=utf8,this solves the problem.

yes,and then use one ’unicodeUtil‘ to convert

stevensam-lin avatar Sep 29 '21 08:09 stevensam-lin