Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1863

Timestamp "<>" operator compares box references instead of values

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.14.0, 1.13.0, 1.12.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In MySQL:
      USE db;
      CREATE TABLE test(id INTEGER NOT NULL PRIMARY KEY, dt datetime NOT NULL);
      INSERT INTO test values (1, '2017-06-29 09:00:00');

      Then connect to it twice, and full outer join on the primary key where the timestamp is different:

      Connection connection = DriverManager.getConnection("jdbc:calcite:", info);
      CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
      SchemaPlus rootSchema = calciteConnection.getRootSchema();
      JdbcSchema a = JdbcSchema.create(calciteConnection.getRootSchema(),
                          "A", aDataSource, null, "db");
      rootSchema.add("A", a);
      JdbcSchema b = JdbcSchema.create(calciteConnection.getRootSchema(),
                          "B", bDataSource, null, "db");
      rootSchema.add("B", b);
      PreparedStatement st = connection.prepareStatement(
                          "SELECT * FROM A.test AS a FULL OUTER JOIN B.test AS b " +
                          "ON a.id=b.id " +
                          "WHERE a.dt <> b.dt");
      ResultSet results = st.executeQuery();
      

      results now contains that row joined to itself, since the "dt" in WHERE tested as not equal to itself.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              damjan Damjan Jovanovic

              Dates

              • Created:
                Updated:

                Issue deployment