sorry, JIRA already created: https://issues.apache.org/jira/browse/KYLIN-1817
2016-06-23 16:45 GMT+08:00 ShaoFeng Shi <[email protected]>: > Hi TongXin, would you mind to open a JIRA for this? and please provide the > Kylin version number, thank you. > > 2016-06-23 14:30 GMT+08:00 仇同心 <[email protected]>: > >> 大家好: >> >> 用kylin的JDBC查询,查询条件是date类型的,但是查询不出数据,以下是代码: >> >> driver = (Driver) Class.*forName*( >> "org.apache.kylin.jdbc.Driver").newInstance(); >> >> >> >> Properties info = *new* Properties(); >> >> info.put("user", "ADMIN"); >> >> info.put("password", "KYLIN"); >> >> >> >> conn = driver.connect("jdbc:kylin://IP:7070/learn_kylin", >> info); (此处IP代替了真实IP地址) >> >> state = conn.prepareStatement("select * from KYLIN_SALES >> where part_dt = ?"); >> >> >> >> SimpleDateFormat simpleTime = *new* SimpleDateFormat( >> "yyyy-MM-dd"); >> >> java.util.Date passUtilDate = simpleTime.parse("2013-01-01"); >> >> >> java.sql.Date passSqlDate = *new* >> java.sql.Date(passUtilDate.getTime()); >> >> >> >> System.*out*.println("passSqlDate-------->"+passSqlDate); >> >> >> >> state.setDate(1, passSqlDate); >> >> >> >> resultSet = state.executeQuery(); >> >> >> >> >> >> 控制台日志为: >> >> passSqlDate-------->2013-01-01 >> >> 2016-06-23 14:19:52,591 DEBUG [main] jdbc.KylinClient:341 : Post body: >> >> {"sql":"select * from KYLIN_SALES where part_dt = >> ?","project":"learn_kylin","acceptPartial":false,"params":[{"className":"java.lang.Integer","value":"15706"}]} >> >> 2016-06-23 14:19:52,592 DEBUG [main] wire.content:84 : << >> "{"userDetails":{"password":null,"username":"ADMIN","authorities":[{"authority":"ROLE_ADMIN"},{"authority":"ROLE_ANALYST"},{"authority":"ROLE_MODELER"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true}}" >> >> >> >> 为什么kylin把传进的参数转为了 >> "params":[{"className":"java.lang.Integer","value":"15706"}]??? >> >> >> >> >> >> 谢谢! >> >> >> >> >> > > > > -- > Best regards, > > Shaofeng Shi > > -- Best regards, Shaofeng Shi
