Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-2815

Empty results with prepareStatement but OK with KylinStatement

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: v2.1.0
    • Fix Version/s: None
    • Component/s: Driver - JDBC
    • Labels:

      Description

      Actually, my prepareStatement queries works well with kylin version v2.0.
      After I upgrade kylin to version v2.1, all queries have no results return,

      Then I write test:

      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://IP:7070/project_name", info);
      PreparedStatement pst = conn.prepareStatement("select XX where XX = ? ")
      pst.setInt(1, 1);
      ResultSet resultSet = pst.executeQuery();
      

      Return no results, and after that I change the query to statement

      Statement state = conn.createStatement();
      ResultSet resultSet = state.executeQuery("select XX where XX = 1")
      

      Finally, I got return values.
      I have no idea whether it is a bug or I have done something wrong with upgrade?
      As I have removed HBase tables “kylin_metadata_user” and “kylin_metadata_acl", I think
      I can't come back to version v2.0 any more

      I also try changed dependency kylin-jdbc to version 2.1.0 but help nothing.

        Issue Links

          Activity

          Hide
          yimingliu Billy Liu added a comment -

          Thanks for reporting. It's an issue, introduced by Prepare logic refactor in the backend.

          Show
          yimingliu Billy Liu added a comment - Thanks for reporting. It's an issue, introduced by Prepare logic refactor in the backend.
          Hide
          Internal
          zhaotianshuo zhaotianshuo added a comment -

          I have the same issue , resolved by switch all my sql config from prepareStatement to normal statement , all sql params are directly concat into sql string.

          Show
          Internal
          zhaotianshuo zhaotianshuo added a comment - I have the same issue , resolved by switch all my sql config from prepareStatement to normal statement , all sql params are directly concat into sql string.
          Hide
          liyang.gmt8@gmail.com liyang added a comment -

          We should add more prepared statement IT so these issues can be detected during CI.

          Show
          liyang.gmt8@gmail.com liyang added a comment - We should add more prepared statement IT so these issues can be detected during CI.
          Hide
          wormholer Wang Cheng added a comment -

          It seems the same reason as KYLIN-2806, please refer https://issues.apache.org/jira/browse/KYLIN-2806

          Show
          wormholer Wang Cheng added a comment - It seems the same reason as KYLIN-2806 , please refer https://issues.apache.org/jira/browse/KYLIN-2806

            People

            • Assignee:
              wormholer Wang Cheng
              Reporter:
              youcheng.zhang youcheng.zhang
              Request participants:
              None
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: