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

JDBC error for float and double values

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.0
    • Component/s: Driver - JDBC
    • Labels:
      None

      Description

      1. Create cube which contains float or double value
      2. Create connection and statement with JDBC driver:

      Driver driver = (Driver) Class.forName("com.kylinolap.jdbc.Driver").newInstance();
      
      Properties info = new Properties();
      info.put("user", "admin");
      info.put("password", "KYLIN");
      info.put("ssl", false);
      
      Connection con = driver.connect("jdbc:kylin://localhost/shop_project", info);
      Statement state = con.createStatement();
      
      state.executeQuery("SELECT * FROM DEFAULT.SALES");
      

      Error:

      [ERROR][com.kylinolap.jdbc.KylinMetaImpl.prepare(KylinMetaImpl.java:339)] - For input string: "0.0"
      java.lang.NumberFormatException: For input string: "0.0"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Long.parseLong(Long.java:441)
        at java.lang.Long.parseLong(Long.java:483)
        at com.kylinolap.jdbc.util.SQLTypeMap.wrapObject(SQLTypeMap.java:164)
        at com.kylinolap.jdbc.stub.KylinClient.genResultData(KylinClient.java:202)
        at com.kylinolap.jdbc.stub.KylinClient.query(KylinClient.java:185)
        at com.kylinolap.jdbc.KylinMetaImpl.prepare(KylinMetaImpl.java:337)
        at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:76)
        at org.dude.kylin_con.TestConnection.main(TestConnection.java:26)
      Exception in thread "main" java.sql.SQLException: error while executing SQL "SELECT * FROM "DEFAULT"."SALES"": Failed to query kylin server with exception For input string: "0.0"
        at net.hydromatic.avatica.Helper.createException(Helper.java:39)
        at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:79)
        at org.dude.kylin_con.TestConnection.main(TestConnection.java:26)
      Caused by: java.lang.RuntimeException: Failed to query kylin server with exception For input string: "0.0"
        at com.kylinolap.jdbc.KylinMetaImpl.prepare(KylinMetaImpl.java:340)
        at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:76)
        ... 1 more
      

      Reason: SQLTypeMap.java
      The problem is that the driver does not distinguish between float and integer values.

        Attachments

          Activity

            People

            • Assignee:
              liyang.gmt8@gmail.com liyang
              Reporter:
              mustangore S├ębastien Jelsch

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment