jaykanakiya commented on code in PR #19258:
URL: https://github.com/apache/druid/pull/19258#discussion_r3036210749
##########
processing/src/main/java/org/apache/druid/data/input/impl/StringDimensionSchema.java:
##########
@@ -66,11 +72,23 @@ public StringDimensionSchema(
@JsonProperty("name") String name,
@JsonProperty("multiValueHandling") MultiValueHandling
multiValueHandling,
@JsonProperty("createBitmapIndex") Boolean createBitmapIndex,
- @JsonProperty("maxStringLength") @Nullable Integer maxStringLength
+ @JsonProperty("maxStringLength") @Nullable Integer maxStringLength,
Review Comment:
Removed maxStringLength from StringDimensionSchema.
##########
processing/src/main/java/org/apache/druid/segment/StringColumnFormatSpec.java:
##########
@@ -0,0 +1,205 @@
+/*
+ * 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.segment;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.druid.data.input.impl.DimensionSchema;
+
+import javax.annotation.Nullable;
+import java.util.Objects;
+
+public class StringColumnFormatSpec
+{
+ private static final StringColumnFormatSpec DEFAULT =
+ builder()
+ .setCreateBitmapIndex(true)
+
.setMultiValueHandling(DimensionSchema.MultiValueHandling.SORTED_ARRAY)
+ .build();
+
+ public static Builder builder()
+ {
+ return new Builder();
+ }
+
+ public static Builder builder(StringColumnFormatSpec spec)
+ {
+ return new Builder(spec);
+ }
+
+ public static StringColumnFormatSpec getEffectiveFormatSpec(
+ @Nullable StringColumnFormatSpec columnFormatSpec,
+ IndexSpec indexSpec
+ )
+ {
+ final Builder builder = columnFormatSpec == null ? builder() :
builder(columnFormatSpec);
+
+ final StringColumnFormatSpec defaultSpec;
+ if (indexSpec.getStringColumnFormatSpec() != null) {
+ defaultSpec = indexSpec.getStringColumnFormatSpec();
+ } else {
+ defaultSpec = DEFAULT;
+ }
+
+ if (builder.createBitmapIndex == null) {
+ if (defaultSpec.getCreateBitmapIndex() != null) {
+ builder.setCreateBitmapIndex(defaultSpec.getCreateBitmapIndex());
+ } else {
+ builder.setCreateBitmapIndex(DEFAULT.getCreateBitmapIndex());
+ }
+ }
+
+ if (builder.multiValueHandling == null) {
+ if (defaultSpec.getMultiValueHandling() != null) {
+ builder.setMultiValueHandling(defaultSpec.getMultiValueHandling());
+ } else {
+ builder.setMultiValueHandling(DEFAULT.getMultiValueHandling());
+ }
+ }
+
+ if (builder.maxStringLength == null) {
+ // No DEFAULT fallback needed: null means "no truncation"
+ builder.setMaxStringLength(defaultSpec.getMaxStringLength());
+ }
+
+ return builder.build();
+ }
+
+ @Nullable
+ private final Boolean createBitmapIndex;
+
+ @Nullable
+ private final DimensionSchema.MultiValueHandling multiValueHandling;
+
+ @Nullable
+ private final Integer maxStringLength;
+
+ @JsonCreator
+ public StringColumnFormatSpec(
+ @JsonProperty("createBitmapIndex") @Nullable Boolean createBitmapIndex,
Review Comment:
Added `StringBitmapIndexType` class with dictionaryEncodedValueIndex and
none options and replaced `createBitmapIndex` in columnFormatSpec.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]