Case
The data that was queried was January 2, 2016, but the data that was parsed was really number 2nd, but the time turned out to be January 1, 2016.
Solve:
is the time zone problem, modify the local time zone
The specific code, mainly look at the red plus bold:
public static void Querytest () throws SQLException, Instantiationexception,illegalaccessexception, classnotfoundexception {system.setproperty ("User.timezone", "GMT +08"); Driver Driver = (Driver) class.forname ("Org.apache.kylin.jdbc.Driver"). newinstance (); Properties Info = new properties (), Info.put ("User", "ADMIN"), Info.put ("Password", "KYLIN"), Info.put (" Uselegacydatetimecode "," false "); Connection conn = Driver.connect ("Jdbc:kylin://192.168.22.102:7070/dataplat", info); Statement state = Conn.createstatement (); ResultSet ResultSet = State.executequery ("Select cppadate,count (1) from Kpi_base_datacppafollowcrccount where cppadate>= ' 2016-01-12 ' and cppadate<= ' 2016-01-12 ' GROUP by Cppadate '), while (Resultset.next ()) { System.out.println (Resultset.getdate (1) + "__" + Resultset.getint (2));}}
Kylin query occurrence date does not correspond to the situation