Skip to content

Commit

Permalink
Remove deprecated.legacy-log-function feature toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveen2112 authored and martint committed Jan 25, 2019
1 parent 47ba96e commit d04152e
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
import io.prestosql.operator.scalar.MapSubscriptOperator;
import io.prestosql.operator.scalar.MapValues;
import io.prestosql.operator.scalar.MathFunctions;
import io.prestosql.operator.scalar.MathFunctions.LegacyLogFunction;
import io.prestosql.operator.scalar.MultimapFromEntriesFunction;
import io.prestosql.operator.scalar.QuantileDigestFunctions;
import io.prestosql.operator.scalar.Re2JRegexpFunctions;
Expand Down Expand Up @@ -659,10 +658,6 @@ public FunctionRegistry(TypeManager typeManager, BlockEncodingSerde blockEncodin
break;
}

if (featuresConfig.isLegacyLogFunction()) {
builder.scalar(LegacyLogFunction.class);
}

addFunctions(builder.getFunctions());

if (typeManager instanceof TypeRegistry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,6 @@ public static Slice absLong(@SqlType("decimal(p, s)") Slice arg)
}
}

@ScalarFunction("log")
@Description("logarithm to given base")
public static final class LegacyLogFunction
{
private LegacyLogFunction() {}

@SqlType(StandardTypes.DOUBLE)
public static double log(@SqlType(StandardTypes.DOUBLE) double number, @SqlType(StandardTypes.DOUBLE) double base)
{
return Math.log(number) / Math.log(base);
}
}

@Description("absolute value")
@ScalarFunction("abs")
@SqlType(StandardTypes.REAL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class FeaturesConfig
private boolean pushTableWriteThroughUnion = true;
private boolean exchangeCompressionEnabled;
private boolean legacyArrayAgg;
private boolean legacyLogFunction;
private boolean groupByUsesEqualTo;
private boolean legacyTimestamp = true;
private boolean legacyMapSubscript;
Expand Down Expand Up @@ -233,18 +232,6 @@ public boolean isLegacyArrayAgg()
return legacyArrayAgg;
}

@Config("deprecated.legacy-log-function")
public FeaturesConfig setLegacyLogFunction(boolean value)
{
this.legacyLogFunction = value;
return this;
}

public boolean isLegacyLogFunction()
{
return legacyLogFunction;
}

@Config("deprecated.group-by-uses-equal")
public FeaturesConfig setGroupByUsesEqualTo(boolean value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected AbstractTestFunctions(FeaturesConfig config)
protected AbstractTestFunctions(Session session, FeaturesConfig config)
{
this.session = requireNonNull(session, "session is null");
this.config = requireNonNull(config, "config is null").setLegacyLogFunction(true);
this.config = requireNonNull(config, "config is null");
}

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,20 +473,6 @@ public void testLog10()
assertFunction("log10(NULL)", DOUBLE, null);
}

@Test
public void testLog()
{
for (double doubleValue : DOUBLE_VALUES) {
for (double base : DOUBLE_VALUES) {
assertFunction("log(" + doubleValue + ", " + base + ")", DOUBLE, Math.log(doubleValue) / Math.log(base));
assertFunction("log(REAL '" + (float) doubleValue + "', REAL'" + (float) base + "')", DOUBLE, Math.log((float) doubleValue) / Math.log((float) base));
}
}
assertFunction("log(NULL, NULL)", DOUBLE, null);
assertFunction("log(5.0E0, NULL)", DOUBLE, null);
assertFunction("log(NULL, 5.0E0)", DOUBLE, null);
}

@Test
public void testMod()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public void testDefaults()
.setMemoryRevokingThreshold(0.9)
.setMemoryRevokingTarget(0.5)
.setOptimizeMixedDistinctAggregations(false)
.setLegacyLogFunction(false)
.setIterativeOptimizerEnabled(true)
.setIterativeOptimizerTimeout(new Duration(3, MINUTES))
.setEnableStatsCalculator(true)
Expand Down Expand Up @@ -123,7 +122,6 @@ public void testExplicitPropertyMappings()
.put("optimizer.ignore-stats-calculator-failures", "false")
.put("optimizer.default-filter-factor-enabled", "true")
.put("deprecated.legacy-array-agg", "true")
.put("deprecated.legacy-log-function", "true")
.put("deprecated.group-by-uses-equal", "true")
.put("deprecated.legacy-map-subscript", "true")
.put("deprecated.legacy-row-field-ordinal-access", "true")
Expand Down Expand Up @@ -218,7 +216,6 @@ public void testExplicitPropertyMappings()
.setSpillMaxUsedSpaceThreshold(0.8)
.setMemoryRevokingThreshold(0.2)
.setMemoryRevokingTarget(0.8)
.setLegacyLogFunction(true)
.setExchangeCompressionEnabled(true)
.setLegacyTimestamp(false)
.setLegacyRowFieldOrdinalAccess(true)
Expand Down

This file was deleted.

0 comments on commit d04152e

Please sign in to comment.