Repository navigation
Fixed ClassCastException during Multi-Stage Queries on real-time segments #16607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
nozjkoitop
wants to merge
15
commits into
apache:master
from
deep-bi:feature-fix-msq-with-hllsketch-in-realtime
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d62532b
Fixed issue where running Multi-Stage Queries on real-time segments …
nozjkoitop c3ac9dd
Checkstyle fix
nozjkoitop 8271050
Moved parameter validation to ObjectStrategy
nozjkoitop 0f17dd3
Merge remote-tracking branch 'upstream/master' into feature-fix-msq-w…
nozjkoitop 7e902a3
Merge remote-tracking branch 'upstream/master' into feature-fix-msq-w…
nozjkoitop 82fc405
Added test-case to MSQSelectTest
nozjkoitop 24fea78
Merge remote-tracking branch 'upstream/master' into feature-fix-msq-w…
nozjkoitop 5cbd4ac
Added columnTypes to expected query
nozjkoitop d4d8eda
upstream merged
nozjkoitop 7ffe8b5
Merge remote-tracking branch 'upstream/master' into feature-fix-msq-w…
nozjkoitop 27f5157
Minor post-merge fix
nozjkoitop cd2e5e4
checkstyle
nozjkoitop 75c0af1
trigger checks
nozjkoitop f2a1c38
fix tests
nozjkoitop f930236
checkstyle
nozjkoitop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
...apache/druid/query/aggregation/datasketches/hll/HllSketchBuildComplexMetricSerdeTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.druid.query.aggregation.datasketches.hll; | ||
|
|
||
| import org.apache.datasketches.hll.HllSketch; | ||
| import org.apache.datasketches.hll.TgtHllType; | ||
| import org.apache.druid.java.util.common.StringEncoding; | ||
| import org.apache.druid.segment.serde.ComplexMetricSerde; | ||
| import org.apache.druid.segment.serde.ComplexMetrics; | ||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
|
|
||
| public class HllSketchBuildComplexMetricSerdeTest | ||
| { | ||
|
|
||
| @Test | ||
| public void testComplexSerdeToBytesOnRealtimeSegmentSketch() | ||
| { | ||
| ComplexMetrics.registerSerde(HllSketchModule.BUILD_TYPE_NAME, new HllSketchBuildComplexMetricSerde()); | ||
| ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(HllSketchModule.BUILD_TYPE_NAME); | ||
| Assert.assertNotNull(serde); | ||
| HllSketch sketchNew = new HllSketch(14, TgtHllType.HLL_8); | ||
| HllSketchBuildUtil.updateSketch(sketchNew, StringEncoding.UTF16LE, new int[]{1, 2}); | ||
|
|
||
| HllSketchHolder sketchHolder = HllSketchHolder.of(sketchNew); | ||
|
|
||
| byte[] bytes = serde.toBytes(sketchHolder); | ||
| Assert.assertEquals(bytes, serde.toBytes(bytes)); | ||
|
|
||
| HllSketchHolder fromBytesHolder = (HllSketchHolder) serde.fromBytes(bytes, 0, bytes.length); | ||
|
|
||
| Assert.assertEquals(sketchHolder.getSketch().getLgConfigK(), fromBytesHolder.getSketch().getLgConfigK()); | ||
| Assert.assertEquals(sketchHolder.getSketch().getTgtHllType(), fromBytesHolder.getSketch().getTgtHllType()); | ||
| Assert.assertEquals( | ||
| sketchHolder.getSketch().getCompactSerializationBytes(), | ||
| fromBytesHolder.getSketch().getCompactSerializationBytes() | ||
| ); | ||
| Assert.assertEquals( | ||
| sketchHolder.getSketch().getUpdatableSerializationBytes(), | ||
| fromBytesHolder.getSketch().getUpdatableSerializationBytes() | ||
| ); | ||
| Assert.assertEquals(sketchHolder.getSketch().getEstimate(), fromBytesHolder.getSketch().getEstimate(), 0); | ||
| Assert.assertEquals(sketchHolder.getSketch().getLowerBound(1), fromBytesHolder.getSketch().getLowerBound(1), 0); | ||
| Assert.assertEquals(sketchHolder.getSketch().getUpperBound(1), fromBytesHolder.getSketch().getUpperBound(1), 0); | ||
|
|
||
| // During fromBytes() sketches field memory changes to TRUE | ||
| Assert.assertFalse(sketchHolder.getSketch().isMemory()); | ||
| Assert.assertTrue(fromBytesHolder.getSketch().isMemory()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation