You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "adarshsanjeev (via GitHub)" <gi...@apache.org> on 2023/02/15 09:05:11 UTC

[GitHub] [druid] adarshsanjeev opened a new pull request, #13808: Fix MSQ IT test

adarshsanjeev opened a new pull request, #13808:
URL: https://github.com/apache/druid/pull/13808

   Due to LATEST when used in combination with an EXTERN source, all values of __time are seen as 0. This leads to some potentially undeterminsitic values being returned from queries.
   This fixes flaky failures for the MSQ IT tests and unblocks the CICD.
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   
   - [x]  been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] adarshsanjeev commented on a diff in pull request #13808: Fix MSQ IT test

Posted by "adarshsanjeev (via GitHub)" <gi...@apache.org>.
adarshsanjeev commented on code in PR #13808:
URL: https://github.com/apache/druid/pull/13808#discussion_r1111982635


##########
integration-tests-ex/cases/src/test/resources/multi-stage-query/wikipedia_merge_index_msq.sql:
##########
@@ -13,8 +13,8 @@ SELECT
   SUM("added") AS "added",
   SUM("deleted") AS "deleted",
   SUM("delta") AS "delta",
-  EARLIEST("user", 128) AS "first_user",
-  LATEST("user", 128) AS "last_user"
+  EARLIEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "first_user",
+  LATEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "last_user"

Review Comment:
   Thanks a lot for the suggestion! That sounds like a good way to handle this. I have made the changes.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] paul-rogers commented on a diff in pull request #13808: Fix MSQ IT test

Posted by "paul-rogers (via GitHub)" <gi...@apache.org>.
paul-rogers commented on code in PR #13808:
URL: https://github.com/apache/druid/pull/13808#discussion_r1110208768


##########
integration-tests-ex/cases/src/test/resources/multi-stage-query/wikipedia_merge_index_msq.sql:
##########
@@ -13,8 +13,8 @@ SELECT
   SUM("added") AS "added",
   SUM("deleted") AS "deleted",
   SUM("delta") AS "delta",
-  EARLIEST("user", 128) AS "first_user",
-  LATEST("user", 128) AS "last_user"
+  EARLIEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "first_user",
+  LATEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "last_user"

Review Comment:
   How about this. This test did, in fact, find a bug, so it is useful. But, the point of the test is actually to exercise something else.
   
   So, maybe comment out the lines that fail. Ensure we have an Apache issue for the problem. Have that problem point to the test and say that, to see the bug, just uncomment the lines.
   
   Then, go ahead and add your new lines so that the test passes.
   
   This will achieve the short-term goal (clean test) while also ensuring we don't forget to fix the underlying issue.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] adarshsanjeev commented on a diff in pull request #13808: Fix MSQ IT test

Posted by "adarshsanjeev (via GitHub)" <gi...@apache.org>.
adarshsanjeev commented on code in PR #13808:
URL: https://github.com/apache/druid/pull/13808#discussion_r1109243311


##########
integration-tests-ex/cases/src/test/resources/multi-stage-query/wikipedia_merge_index_msq.sql:
##########
@@ -13,8 +13,8 @@ SELECT
   SUM("added") AS "added",
   SUM("deleted") AS "deleted",
   SUM("delta") AS "delta",
-  EARLIEST("user", 128) AS "first_user",
-  LATEST("user", 128) AS "last_user"
+  EARLIEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "first_user",
+  LATEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "last_user"

Review Comment:
   I agree, this isn't a fix, it's a workaround, but the tests that are failing are not to check for aggregations. This is used for a few tests like BatchIngest test and ReindexTest, and any aggregation would work for these tests. Disabling them might make a part of the code untested instead. Should I disable these tests for now?
   
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] paul-rogers merged pull request #13808: Fix MSQ IT test

Posted by "paul-rogers (via GitHub)" <gi...@apache.org>.
paul-rogers merged PR #13808:
URL: https://github.com/apache/druid/pull/13808


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] paul-rogers commented on a diff in pull request #13808: Fix MSQ IT test

Posted by "paul-rogers (via GitHub)" <gi...@apache.org>.
paul-rogers commented on code in PR #13808:
URL: https://github.com/apache/druid/pull/13808#discussion_r1107749038


##########
integration-tests-ex/cases/src/test/resources/multi-stage-query/wikipedia_merge_index_msq.sql:
##########
@@ -13,8 +13,8 @@ SELECT
   SUM("added") AS "added",
   SUM("deleted") AS "deleted",
   SUM("delta") AS "delta",
-  EARLIEST("user", 128) AS "first_user",
-  LATEST("user", 128) AS "last_user"
+  EARLIEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "first_user",
+  LATEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "last_user"

Review Comment:
   This is not a "fix", it is a workaround that allows the test to pass through the underlying code is broken. A better approach is to simply disable the test with a comment.
   
   That is, this "fix" substitutes another test case (which works) for the test case which fails because it is revealing a bug.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org