The issue should have been fixed in Kylin 2.2. Please have a try. 2017-10-31 19:16 GMT+08:00 我们 <294344...@qq.com>:
> kylin2.1的cdh版本 jdbc接口(bug) > > 直接拼接sql能查询 > > 像图中方块圈出的那种 传参数的方式,查询不返回结果 > > 后面附上了测试不通过的代码。 > > 我换成kylin2.0.0版本是可以正常查询的。 > > (kylin2.1.0和kylin2.0.0的cdh版本都是CDH-5.11.1-1.cdh5.11.1.p0.4) > > public class Test { > > > > public static void main(String[] args) throws Exception { > > Driver driver = (Driver) Class.forName("org.apache. > kylin.jdbc.Driver").newInstance(); > > Properties info = new Properties(); > > info.put("user", "ADMIN"); > > info.put("password", "KYLIN"); > > Connection conn = driver.connect("jdbc:kylin://1 > 92.168.100.114:7070/learn_kylin", info); > > PreparedStatement state = conn.prepareStatement(" > SELECT m.class_code AS acccode,'ss' AS dscrp, SUM(b.opfare) AS sums FROM > m_rec_consume_copy b LEFT JOIN m_consume_type m ON b.acccode=m.acccode > WHERE "+ > > " 1=1 AND b.class_code IN "+ > > " (?,?,?,?,?,?,?,?) "+ > > // " (1681115971,1622196052,14457422,12457013,13457331, > 1581115221,14457431,1522198021) "+ > > " GROUP BY m.class_code "+ > > " ORDER BY sums DESC "); > > state.setString(1, "1681115971"); > > state.setString(2, "1622196052"); > > state.setString(3, "14457422"); > > state.setString(4, "12457013"); > > state.setString(5, "13457331"); > > state.setString(6, "1581115221"); > > state.setString(7, "14457431"); > > state.setString(8, "1522198021"); > > ResultSet resultSet = state.executeQuery(); > > while (resultSet.next()) { > > System.out.println(resultSet. > getString(1)+"||"+resultSet.getString(2)+"||"+resultSet.getString(3)); > > } > > } > > > > } >