Skip to content

Commit 259e62e

Browse files
authored
Adds support for compute JSON from dictionary. JSON data can now be computed from its dictionary/ index, with an option to skip storing the raw JSON entirely (#18589)
* derive-json * default-read-raw * object-encoding * default * buffer * format * lazy-supplier * revert-column-config * serializer * supplier * value-provider * test * javadoc * get-row-value * nested * format * test * trigger ci / empty commit * static
1 parent d1fcff8 commit 259e62e

File tree

15 files changed

+1283
-555
lines changed

15 files changed

+1283
-555
lines changed

processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnHolderRACColumn.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919

2020
package org.apache.druid.query.rowsandcols.concrete;
2121

22-
import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector;
2322
import org.apache.druid.query.rowsandcols.column.Column;
2423
import org.apache.druid.query.rowsandcols.column.ColumnAccessor;
2524
import org.apache.druid.segment.ColumnValueSelector;
2625
import org.apache.druid.segment.column.BaseColumn;
2726
import org.apache.druid.segment.column.BaseColumnHolder;
2827
import org.apache.druid.segment.column.ColumnType;
29-
import org.apache.druid.segment.data.ReadableOffset;
28+
import org.apache.druid.segment.data.AtomicIntegerReadableOffset;
3029

3130
import javax.annotation.Nonnull;
3231
import javax.annotation.Nullable;
@@ -161,26 +160,4 @@ public BaseColumn getBaseColumn()
161160
}
162161
return baseColumn;
163162
}
164-
165-
private static class AtomicIntegerReadableOffset implements ReadableOffset
166-
{
167-
private final AtomicInteger offset;
168-
169-
public AtomicIntegerReadableOffset(AtomicInteger offset)
170-
{
171-
this.offset = offset;
172-
}
173-
174-
@Override
175-
public int getOffset()
176-
{
177-
return offset.get();
178-
}
179-
180-
@Override
181-
public void inspectRuntimeShape(RuntimeShapeInspector inspector)
182-
{
183-
184-
}
185-
}
186163
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.druid.segment.data;
21+
22+
import org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector;
23+
24+
import java.util.concurrent.atomic.AtomicInteger;
25+
26+
/**
27+
* A {@link ReadableOffset} implementation that wraps an AtomicInteger.
28+
*/
29+
public class AtomicIntegerReadableOffset implements ReadableOffset
30+
{
31+
private final AtomicInteger offset;
32+
33+
public AtomicIntegerReadableOffset(AtomicInteger offset)
34+
{
35+
this.offset = offset;
36+
}
37+
38+
@Override
39+
public int getOffset()
40+
{
41+
return offset.get();
42+
}
43+
44+
@Override
45+
public void inspectRuntimeShape(RuntimeShapeInspector inspector)
46+
{
47+
48+
}
49+
}

0 commit comments

Comments
 (0)