[jira] [Created] (CALCITE-3375) calcite concat function

2019-09-26 Thread cui (Jira)
cui created CALCITE-3375:


 Summary: calcite concat function
 Key: CALCITE-3375
 URL: https://issues.apache.org/jira/browse/CALCITE-3375
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.21.0
Reporter: cui


I use calcite to connect mysql to test, I have two column test data , age(int) 
and name(varchar) and the table name is test.score_new, and I have two row test 
data following:
--

id  nameage
--

1   飞   16
--
when I use the sql : select '飞'||16 or select '飞'||'16' , it will return the 
right result : EXPR$0=飞16
But when I use the sql : select "name"||"age" from "test"."score_new", it will 
return the result : EXPR$0=1,
and sql : select "sid"||"sid" from "test"."score_new", it will return : 
EXPR$0=1,
and sql : select "name"||"name" from "test"."score_new", it will return : 
EXPR$0=0,
the result is not what I want, I want to get the result : 飞16, why ? and How to 
solve this problem



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


[jira] [Created] (CALCITE-3351) calcite mysql utf8中文查询报错

2019-09-16 Thread cui (Jira)
cui created CALCITE-3351:


 Summary: calcite mysql utf8中文查询报错
 Key: CALCITE-3351
 URL: https://issues.apache.org/jira/browse/CALCITE-3351
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.19.0
 Environment: 无论是windows还是mac,都会出同样的错误
Reporter: cui


发现连接mysql进行中文查询时候,执行这条sql:

select * from \"test\".\"score_new\" where \"name\"= \'催\' limit 1报错

,后来修改了RelDataTypeFactoryImpl的

getDefaultCharset方法为

return Charset.forName("UTF8");

还是报错,报错如下:

java.sql.SQLException: Error while executing SQL "select * from 
"test"."score_new" where "name"= '催' limit 1": While executing SQL [SELECT 
*java.sql.SQLException: Error while executing SQL "select * from 
"test"."score_new" where "name"= '催' limit 1": While executing SQL [SELECT 
*FROM `score_new`WHERE `name` = u&'\50ac'LIMIT 1] on JDBC sub-schema at 
org.apache.calcite.avatica.Helper.createException(Helper.java:56) at 
org.apache.calcite.avatica.Helper.createException(Helper.java:41) at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
 at 
org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227)
 at QueryMysql.main(QueryMysql.java:42)Caused by: java.lang.RuntimeException: 
While executing SQL [SELECT *FROM `score_new`WHERE `name` = u&'\50ac'



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-2004) The TableFunction left outer join was improperly translated

2017-10-08 Thread Xingcan Cui (JIRA)
Xingcan Cui created CALCITE-2004:


 Summary: The TableFunction left outer join was improperly 
translated
 Key: CALCITE-2004
 URL: https://issues.apache.org/jira/browse/CALCITE-2004
 Project: Calcite
  Issue Type: Bug
Reporter: Xingcan Cui
Assignee: Julian Hyde


Currently the TableFunction left outer join is translated to a 
{{LogicalCorrelate}} followed by a {{LogicalFilter}}. For instance, given a 
simple table {{WordCount(word:String, frequency:Int)}}, a table function 
{{split: word:String => (letter:String, length:String)}}, and a query {{SELECT 
word, letter, length FROM WordCount LEFT JOIN LATERAL TABLE(split(word)) AS T 
(letter, length) ON frequency = length OR length < 5"}} the query will be 
translated to the logical plan below.
{code:java}
LogicalProject(word=[$0], name=[$2], length=[$3])
  LogicalFilter(condition=[OR(=($1, CAST($3):BIGINT), <($3, 5))])
LogicalCorrelate(correlation=[$cor0], joinType=[left], 
requiredColumns=[{0}])
  LogicalTableScan(table=[[WordCount]])
  LogicalTableFunctionScan(invocation=[split($cor0.word)], 
rowType=[RecordType(VARCHAR(65536) _1, INTEGER _2)], elementType=[class 
[Ljava.lang.Object;])
{code}
With this plan, an outer row might be completely filtered out (instead of being 
padded with null) if the join predicate filter filters out all join results 
produced by a correlate join for the outer row. Maybe we should attach the 
filter to the correlate operation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)