[ 
https://issues.apache.org/jira/browse/KYLIN-4354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17136355#comment-17136355
 ] 

ASF GitHub Bot commented on KYLIN-4354:
---------------------------------------

RupengWang commented on pull request #1165:
URL: https://github.com/apache/kylin/pull/1165#issuecomment-644562468


   ## Design test cases
   
   ### Prepare test env
   #### Hadoop Env
   CDH 5.7
   #### source table
   1. Create hive table using local csv file
   id,name,dt
   1,wang,2019-01-01
   2,zhang,2019-01-02
   3,Lee,2019-01-03
   4,Liu,2019-01-04
   2. create table in hive
   ```sql
   CREATE TABLE wangrupeng.self_define_date(id int, name string, dt string) row 
format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES 
("separatorChar"=",") STORED AS TEXTFILE;
   ```
   3. load csv to hive table
   ```sql
   load data local inpath '/root/wangrupeng/kylin-3.1.0/test.csv' overwrite 
into table self_define_date;
   ```
   #### Create a new model and cube with fact table self_define_date
   
   #### Open IDEA and prepare a Demo
   ```java
   package io.kyligence.jdbc;
   
   import org.apache.kylin.jdbc.Driver;
   
   import java.sql.Connection;
   import java.sql.PreparedStatement;
   import java.sql.ResultSet;
   import java.sql.Statement;
   import java.util.Properties;
   
   public class KylinJDBCDemo {
       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://cdh-client:7171/learn_kylin", info);
           //Statement state = conn.createStatement();
           //ResultSet resultSet = state.executeQuery("select count(*) from 
kylin_sales where part_dt='2012-01-01'");
   
           PreparedStatement preparedStatement = conn.prepareStatement("select 
count(*) from wangrupeng.self_define_date where dt=?");
           preparedStatement.setString(1, "2019-01-01");
           ResultSet resultSet = preparedStatement.executeQuery();
   
           while (resultSet.next()) {
               System.out.println(resultSet.getString(1));
           }
       }
   }
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Prune segment not using given filter when using jdbc preparestatement
> ---------------------------------------------------------------------
>
>                 Key: KYLIN-4354
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4354
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.6.2
>            Reporter: QiangZhang
>            Assignee: Yaqian Zhang
>            Priority: Minor
>             Fix For: v3.1.0, v3.0.2, v2.6.6
>
>         Attachments: image-2020-01-19-10-34-39-637.png, 
> image-2020-01-19-10-36-27-864.png
>
>
> When use jdbc preparestatement query kylin,prune segment not using given 
> filter(lead to scan all segments)
> !image-2020-01-19-10-36-27-864.png!
> !image-2020-01-19-10-34-39-637.png!
>  



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

Reply via email to