Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-2887

Fix broken IN - it now takes first element only

    XMLWordPrintable

    Details

    • Story Points:
      8
    • Sprint:
      DB_S15_07, DB_S15_08, DB_W16_09
    • Team:
      Data Access and Database

      Description

      IN is broken - it only uses the first element from the list. Here is the proof:

      select COUNT(*) AS N FROM qservTest_case01_qserv.Source 
      WHERE objectId=386950783579546;
      +------+
      | N    |
      +------+
      |   56 |
      +------+
      1 row in set (0.10 sec)
       
      mysql> select count(*) AS N FROM qservTest_case01_qserv.Source
      WHERE objectId=386942193651348;
      +------+
      | N    |
      +------+
      |   39 |
      +------+
      1 row in set (0.09 sec)
       
      mysql> select COUNT(*) AS N FROM qservTest_case01_qserv.Source
      WHERE objectId IN(386942193651348, 386950783579546);
      +------+
      | N    |
      +------+
      |   39 |
      +------+
      1 row in set (0.09 sec)
       
      mysql> select COUNT(*) AS N FROM qservTest_case01_qserv.Source
      WHERE objectId IN(386950783579546, 386942193651348);
      +------+
      | N    |
      +------+
      |   56 |
      +------+
      1 row in set (0.11 sec)
      

        Attachments

          Issue Links

            Activity

            Hide
            jbecla Jacek Becla added a comment -

            Fabrice, I think you will like this one. If not, give it back to me.

            Show
            jbecla Jacek Becla added a comment - Fabrice, I think you will like this one. If not, give it back to me.
            Hide
            jammes Fabrice Jammes added a comment - - edited

            Hi Jacek Becla,

            It's ok for me, thanks!

            But, in the short term, I would like to finish my work on ORDER BY clause first. Are you OK with that? If yes, shall I rename DM-2859 to "Add support for ORDER BY clause" and implement here K.T. idea (i.e. adding a column in the select clause for each ORDER BY field and removing it after aggregation step?). I already invest a lot to implement this feature and I strongly think it should work and only require some simple code. Nevertheless FYI I think it should be at least 10SP.

            Cheers

            Show
            jammes Fabrice Jammes added a comment - - edited Hi Jacek Becla , It's ok for me, thanks! But, in the short term, I would like to finish my work on ORDER BY clause first. Are you OK with that? If yes, shall I rename DM-2859 to "Add support for ORDER BY clause" and implement here K.T. idea (i.e. adding a column in the select clause for each ORDER BY field and removing it after aggregation step?). I already invest a lot to implement this feature and I strongly think it should work and only require some simple code. Nevertheless FYI I think it should be at least 10SP. Cheers
            Hide
            jbecla Jacek Becla added a comment -

            I think the cleanest would be to close DM-2859 and create a new story. But if you already have branch active, just keep using it. If you end up reusing DM-2859, revisit #SPs, after all we are redefining the scope.

            Show
            jbecla Jacek Becla added a comment - I think the cleanest would be to close DM-2859 and create a new story. But if you already have branch active, just keep using it. If you end up reusing DM-2859 , revisit #SPs, after all we are redefining the scope.
            Hide
            jammes Fabrice Jammes added a comment - - edited

            I tried to rebase my best but a few features are entangled. Hope it'll be easy to review. Interesting commit is here: 899dd2bf701971d10f3adb2fa17c43af542cc3e.
            I needed to add tests/logging to chase this bug.

            Please also review qserv_testdata.

            Show
            jammes Fabrice Jammes added a comment - - edited I tried to rebase my best but a few features are entangled. Hope it'll be easy to review. Interesting commit is here: 899dd2bf701971d10f3adb2fa17c43af542cc3e. I needed to add tests/logging to chase this bug. Please also review qserv_testdata.
            Hide
            jbecla Jacek Becla added a comment -

            Nice work Fabrice, I am done with the review, Andy, mark reviewed when done.

            Show
            jbecla Jacek Becla added a comment - Nice work Fabrice, I am done with the review, Andy, mark reviewed when done.
            Hide
            salnikov Andy Salnikov added a comment -

            Fabrice, I'm done reviewing too. General comment - there is a lot of code refactoring beyond simply fixing broken IN. In fact I'm not really sure now what constitutes actual fix. I'd prefer all refactoring to go into separate ticket(s) (not just separate commits).

            A bunch of comments and suggestions in PR. I do not close review yet, if you address all suggestions it will likely need another review

            Show
            salnikov Andy Salnikov added a comment - Fabrice, I'm done reviewing too. General comment - there is a lot of code refactoring beyond simply fixing broken IN. In fact I'm not really sure now what constitutes actual fix. I'd prefer all refactoring to go into separate ticket(s) (not just separate commits). A bunch of comments and suggestions in PR. I do not close review yet, if you address all suggestions it will likely need another review
            Hide
            jammes Fabrice Jammes added a comment -

            Andy Salnikov, all comments have been adressed, thanks. Sorry for all the refactoring but I needed to improve logging/test code in order to chase the bug. And then it was easier to kept everything in the same ticket.

            Show
            jammes Fabrice Jammes added a comment - Andy Salnikov , all comments have been adressed, thanks. Sorry for all the refactoring but I needed to improve logging/test code in order to chase the bug. And then it was easier to kept everything in the same ticket.
            Hide
            salnikov Andy Salnikov added a comment -

            Fabrice, looks OK. I left few more minor comments on PR.

            Show
            salnikov Andy Salnikov added a comment - Fabrice, looks OK. I left few more minor comments on PR.

              People

              Assignee:
              jammes Fabrice Jammes
              Reporter:
              fritzm Fritz Mueller
              Reviewers:
              Andy Salnikov, Jacek Becla
              Watchers:
              Andy Salnikov, Fabrice Jammes, Jacek Becla, Serge Monkewitz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.