use lower_camel for config names

This commit is contained in:
Zoltan Haindrich 2024-05-17 07:00:57 +00:00
parent 94f93865e8
commit 652cc20597
5 changed files with 15 additions and 9 deletions

View File

@ -19,6 +19,7 @@
package org.apache.druid.sql.calcite;
import com.google.common.base.CaseFormat;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
@ -156,10 +157,10 @@ public class SqlTestFrameworkConfig
}
private static final Set<String> KNOWN_CONFIG_KEYS = ImmutableSet.<String>builder()
.add(NumMergeBuffers.class.getSimpleName())
.add(MinTopNThreshold.class.getSimpleName())
.add(ResultCache.class.getSimpleName())
.add(ComponentSupplier.class.getSimpleName())
.add(NumMergeBuffers.PROCESSOR.getConfigName())
.add(MinTopNThreshold.PROCESSOR.getConfigName())
.add(ResultCache.PROCESSOR.getConfigName())
.add(ComponentSupplier.PROCESSOR.getConfigName())
.build();
public final int numMergeBuffers;
@ -408,6 +409,11 @@ public class SqlTestFrameworkConfig
this.annotationClass = annotationClass;
}
public final String getConfigName()
{
return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, annotationClass.getSimpleName());
}
@SuppressWarnings("unchecked")
public final T fromAnnotations(List<Annotation> annotations) throws Exception
{
@ -436,7 +442,7 @@ public class SqlTestFrameworkConfig
public final T fromMap(Map<String, String> map) throws Exception
{
String key = annotationClass.getSimpleName();
String key = getConfigName();
String value = map.get(key);
if (value == null) {
return defaultValue();

View File

@ -1,5 +1,5 @@
!set plannerStrategy DECOUPLED
!use druidtest://?NumMergeBuffers=3
!use druidtest://?numMergeBuffers=3
!set outputformat mysql
select cityName, count(case when delta > 0 then channel end) as cnt, count(1) as aall

View File

@ -1,4 +1,4 @@
!use druidtest://?NumMergeBuffers=3
!use druidtest://?numMergeBuffers=3
!set outputformat mysql
with v as (

View File

@ -1,4 +1,4 @@
!use druidtest://?NumMergeBuffers=3
!use druidtest://?numMergeBuffers=3
!set outputformat mysql
SELECT

View File

@ -1,4 +1,4 @@
!use druidtest://?ComponentSupplier=NestedComponentSupplier
!use druidtest://?componentSupplier=NestedComponentSupplier
!set outputformat mysql
select count(1) from nested;