kylin-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 仇同心 <qiutong...@jd.com>
Subject kylin Remote JDBC Driver problem
Date Thu, 23 Jun 2016 06:30:36 GMT
大家好:
     用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"}]???


谢谢!


Mime
View raw message