Skip to content
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

增加配置accurateCardinality算法在handler中使用中是否开启oneId服务 #20

Open
wants to merge 1 commit into
base: bigo-release-2.3.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@ public static FieldTypeEnum getFieldType(String fieldName) {
}

int k = Integer.parseInt(HiveConf.getVar(jc, HiveConf.ConfVars.HIVE_DRUID_QUANTILES_PARAM_K));
String nameSpace = HiveConf.getVar(jc, HiveConf.ConfVars.HIVE_DRUID_ACCRUATE_CARDINALITY_NAMESPACE);
String openOneId = HiveConf.getVar(jc, HiveConf.ConfVars.HIVE_DRUID_ACCRUATE_CARDINALITY_OPEN_ONEID);

LOG.info("hive.druid.quantiles.k {}", k);
String druidHllTgtType = getTableProperty(tableProperties, jc,
Expand Down Expand Up @@ -1096,6 +1098,11 @@ public static FieldTypeEnum getFieldType(String fieldName) {
aggregatorFactoryBuilder.add(new OldSketchBuildAggregatorFactory(dColumnName,
dColumnName, size));
continue;
} else if (fieldTypeEnum == FieldTypeEnum.ACC) {
LOG.info("column " + dColumnName + " treat as acc metric");
aggregatorFactoryBuilder.add(new AccurateCardinalityAggregatorFactory(dColumnName,
dColumnName, nameSpace, openOneId));
continue;
}

final PrimitiveObjectInspector.PrimitiveCategory
Expand Down
6 changes: 6 additions & 0 deletions common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,12 @@ public static enum ConfVars {
new PatternSet("-1", "1048576","524288","262144", "131072", "65536", "32768", "16384", "8192", "4096", "2048", "1024", "512", "256", "128", "64", "32"),
"https://datasketches.github.io/docs/Theta/ThetaSize.html"
),
HIVE_DRUID_ACCRUATE_CARDINALITY_NAMESPACE("hive.druid.accurate.cardinality.namespace", "hdid",
"the namespace for oneId service in Druid, Only using and working when hive.druid.accurate.cardinality.open.oneid set to true"
),
HIVE_DRUID_ACCRUATE_CARDINALITY_OPEN_ONEID("hive.druid.accurate.cardinality.open.oneid", "false",
"If open oneId service in Druid when using hive2Druid"
),
HIVE_DRUID_MAX_PARTITION_SIZE("hive.druid.indexer.partition.size.max", 5000000,
"Maximum number of records per segment partition"
),
Expand Down