Search in sources :

Example 1 with InternalFunctionBundleBuilder

use of io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder in project trino by trinodb.

the class PluginManager method installPluginInternal.

private void installPluginInternal(Plugin plugin, Function<CatalogName, ClassLoader> duplicatePluginClassLoaderFactory) {
    for (BlockEncoding blockEncoding : plugin.getBlockEncodings()) {
        log.info("Registering block encoding %s", blockEncoding.getName());
        blockEncodingManager.addBlockEncoding(blockEncoding);
    }
    for (Type type : plugin.getTypes()) {
        log.info("Registering type %s", type.getTypeSignature());
        typeRegistry.addType(type);
    }
    for (ParametricType parametricType : plugin.getParametricTypes()) {
        log.info("Registering parametric type %s", parametricType.getName());
        typeRegistry.addParametricType(parametricType);
    }
    for (ConnectorFactory connectorFactory : plugin.getConnectorFactories()) {
        log.info("Registering connector %s", connectorFactory.getName());
        connectorManager.addConnectorFactory(connectorFactory, duplicatePluginClassLoaderFactory);
    }
    Set<Class<?>> functions = plugin.getFunctions();
    if (!functions.isEmpty()) {
        log.info("Registering functions from %s", plugin.getClass().getSimpleName());
        InternalFunctionBundleBuilder builder = InternalFunctionBundle.builder();
        functions.forEach(builder::functions);
        globalFunctionCatalog.addFunctions(builder.build());
    }
    for (SessionPropertyConfigurationManagerFactory sessionConfigFactory : plugin.getSessionPropertyConfigurationManagerFactories()) {
        log.info("Registering session property configuration manager %s", sessionConfigFactory.getName());
        sessionPropertyDefaults.addConfigurationManagerFactory(sessionConfigFactory);
    }
    for (ResourceGroupConfigurationManagerFactory configurationManagerFactory : plugin.getResourceGroupConfigurationManagerFactories()) {
        log.info("Registering resource group configuration manager %s", configurationManagerFactory.getName());
        resourceGroupManager.addConfigurationManagerFactory(configurationManagerFactory);
    }
    for (SystemAccessControlFactory accessControlFactory : plugin.getSystemAccessControlFactories()) {
        log.info("Registering system access control %s", accessControlFactory.getName());
        accessControlManager.addSystemAccessControlFactory(accessControlFactory);
    }
    passwordAuthenticatorManager.ifPresent(authenticationManager -> {
        for (PasswordAuthenticatorFactory authenticatorFactory : plugin.getPasswordAuthenticatorFactories()) {
            log.info("Registering password authenticator %s", authenticatorFactory.getName());
            authenticationManager.addPasswordAuthenticatorFactory(authenticatorFactory);
        }
    });
    for (CertificateAuthenticatorFactory authenticatorFactory : plugin.getCertificateAuthenticatorFactories()) {
        log.info("Registering certificate authenticator %s", authenticatorFactory.getName());
        certificateAuthenticatorManager.addCertificateAuthenticatorFactory(authenticatorFactory);
    }
    headerAuthenticatorManager.ifPresent(authenticationManager -> {
        for (HeaderAuthenticatorFactory authenticatorFactory : plugin.getHeaderAuthenticatorFactories()) {
            log.info("Registering header authenticator %s", authenticatorFactory.getName());
            authenticationManager.addHeaderAuthenticatorFactory(authenticatorFactory);
        }
    });
    for (EventListenerFactory eventListenerFactory : plugin.getEventListenerFactories()) {
        log.info("Registering event listener %s", eventListenerFactory.getName());
        eventListenerManager.addEventListenerFactory(eventListenerFactory);
    }
    for (GroupProviderFactory groupProviderFactory : plugin.getGroupProviderFactories()) {
        log.info("Registering group provider %s", groupProviderFactory.getName());
        groupProviderManager.addGroupProviderFactory(groupProviderFactory);
    }
    for (ExchangeManagerFactory exchangeManagerFactory : plugin.getExchangeManagerFactories()) {
        log.info("Registering exchange manager %s", exchangeManagerFactory.getName());
        exchangeManagerRegistry.addExchangeManagerFactory(exchangeManagerFactory);
    }
}
Also used : ResourceGroupConfigurationManagerFactory(io.trino.spi.resourcegroups.ResourceGroupConfigurationManagerFactory) HeaderAuthenticatorFactory(io.trino.spi.security.HeaderAuthenticatorFactory) EventListenerFactory(io.trino.spi.eventlistener.EventListenerFactory) SystemAccessControlFactory(io.trino.spi.security.SystemAccessControlFactory) Type(io.trino.spi.type.Type) ParametricType(io.trino.spi.type.ParametricType) PasswordAuthenticatorFactory(io.trino.spi.security.PasswordAuthenticatorFactory) ConnectorFactory(io.trino.spi.connector.ConnectorFactory) InternalFunctionBundleBuilder(io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder) ParametricType(io.trino.spi.type.ParametricType) SessionPropertyConfigurationManagerFactory(io.trino.spi.session.SessionPropertyConfigurationManagerFactory) BlockEncoding(io.trino.spi.block.BlockEncoding) CertificateAuthenticatorFactory(io.trino.spi.security.CertificateAuthenticatorFactory) GroupProviderFactory(io.trino.spi.security.GroupProviderFactory) ExchangeManagerFactory(io.trino.spi.exchange.ExchangeManagerFactory)

Example 2 with InternalFunctionBundleBuilder

use of io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder in project trino by trinodb.

the class AbstractTestMLFunctions method registerFunctions.

@BeforeClass
public void registerFunctions() {
    InternalFunctionBundleBuilder builder = InternalFunctionBundle.builder();
    new MLPlugin().getFunctions().forEach(builder::functions);
    functionAssertions.addFunctions(builder.build());
}
Also used : InternalFunctionBundleBuilder(io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with InternalFunctionBundleBuilder

use of io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder in project trino by trinodb.

the class SystemFunctionBundle method create.

public static FunctionBundle create(FeaturesConfig featuresConfig, TypeOperators typeOperators, BlockTypeOperators blockTypeOperators, NodeVersion nodeVersion) {
    InternalFunctionBundleBuilder builder = InternalFunctionBundle.builder().window(RowNumberFunction.class).window(RankFunction.class).window(DenseRankFunction.class).window(PercentRankFunction.class).window(CumulativeDistributionFunction.class).window(NTileFunction.class).window(FirstValueFunction.class).window(LastValueFunction.class).window(NthValueFunction.class).window(LagFunction.class).window(LeadFunction.class).aggregates(ApproximateCountDistinctAggregation.class).aggregates(DefaultApproximateCountDistinctAggregation.class).aggregates(BooleanApproximateCountDistinctAggregation.class).aggregates(BooleanDefaultApproximateCountDistinctAggregation.class).aggregates(SumDataSizeForStats.class).aggregates(MaxDataSizeForStats.class).aggregates(CountAggregation.class).aggregates(VarianceAggregation.class).aggregates(CentralMomentsAggregation.class).aggregates(ApproximateLongPercentileAggregations.class).aggregates(LegacyApproximateLongPercentileAggregations.class).aggregates(ApproximateLongPercentileArrayAggregations.class).aggregates(ApproximateDoublePercentileAggregations.class).aggregates(LegacyApproximateDoublePercentileAggregations.class).aggregates(ApproximateDoublePercentileArrayAggregations.class).aggregates(ApproximateRealPercentileAggregations.class).aggregates(LegacyApproximateRealPercentileAggregations.class).aggregates(ApproximateRealPercentileArrayAggregations.class).aggregates(CountIfAggregation.class).aggregates(BooleanAndAggregation.class).aggregates(BooleanOrAggregation.class).aggregates(DoubleSumAggregation.class).aggregates(RealSumAggregation.class).aggregates(LongSumAggregation.class).aggregates(IntervalDayToSecondSumAggregation.class).aggregates(IntervalYearToMonthSumAggregation.class).aggregates(AverageAggregations.class).function(REAL_AVERAGE_AGGREGATION).aggregates(IntervalDayToSecondAverageAggregation.class).aggregates(IntervalYearToMonthAverageAggregation.class).aggregates(GeometricMeanAggregations.class).aggregates(RealGeometricMeanAggregations.class).aggregates(MergeHyperLogLogAggregation.class).aggregates(ApproximateSetAggregation.class).aggregates(ApproximateSetGenericAggregation.class).aggregates(TDigestAggregationFunction.class).functions(QDIGEST_AGG, QDIGEST_AGG_WITH_WEIGHT, QDIGEST_AGG_WITH_WEIGHT_AND_ERROR).function(MergeQuantileDigestFunction.MERGE).aggregates(MergeTDigestAggregation.class).aggregates(DoubleHistogramAggregation.class).aggregates(RealHistogramAggregation.class).aggregates(DoubleCovarianceAggregation.class).aggregates(RealCovarianceAggregation.class).aggregates(DoubleRegressionAggregation.class).aggregates(RealRegressionAggregation.class).aggregates(DoubleCorrelationAggregation.class).aggregates(RealCorrelationAggregation.class).aggregates(BitwiseOrAggregation.class).aggregates(BitwiseAndAggregation.class).scalar(RepeatFunction.class).scalars(SequenceFunction.class).scalars(SessionFunctions.class).scalars(StringFunctions.class).scalars(WordStemFunction.class).scalar(SplitToMapFunction.class).scalar(SplitToMultimapFunction.class).scalars(VarbinaryFunctions.class).scalars(UrlFunctions.class).scalars(MathFunctions.class).scalar(MathFunctions.Abs.class).scalar(MathFunctions.Sign.class).scalar(MathFunctions.Round.class).scalar(MathFunctions.RoundN.class).scalar(MathFunctions.Truncate.class).scalar(MathFunctions.TruncateN.class).scalar(MathFunctions.Ceiling.class).scalar(MathFunctions.Floor.class).scalars(BitwiseFunctions.class).scalars(DateTimeFunctions.class).scalar(DateTimeFunctions.FromUnixtimeNanosDecimal.class).scalars(JsonFunctions.class).scalars(ColorFunctions.class).scalars(HyperLogLogFunctions.class).scalars(QuantileDigestFunctions.class).scalars(TDigestFunctions.class).scalars(BooleanOperators.class).scalars(BigintOperators.class).scalars(IntegerOperators.class).scalars(SmallintOperators.class).scalars(TinyintOperators.class).scalars(DoubleOperators.class).scalars(RealOperators.class).scalars(VarcharOperators.class).scalars(DateOperators.class).scalars(IntervalDayTimeOperators.class).scalars(IntervalYearMonthOperators.class).scalars(DateTimeOperators.class).scalars(HyperLogLogOperators.class).scalars(QuantileDigestOperators.class).scalars(TDigestOperators.class).scalars(IpAddressOperators.class).scalars(IpAddressFunctions.class).scalars(UuidOperators.class).scalars(LikeFunctions.class).scalars(ArrayFunctions.class).scalars(HmacFunctions.class).scalars(DataSizeFunctions.class).scalars(FormatNumberFunction.class).scalar(ArrayCardinalityFunction.class).scalar(ArrayContains.class).scalar(ArrayContainsSequence.class).scalar(ArrayFilterFunction.class).scalar(ArrayPositionFunction.class).scalars(CombineHashFunction.class).scalars(JsonOperators.class).scalars(FailureFunction.class).scalars(JoniRegexpCasts.class).scalars(CharacterStringCasts.class).scalars(LuhnCheckFunction.class).scalar(DecimalOperators.Negation.class).functions(IDENTITY_CAST, CAST_FROM_UNKNOWN).scalar(ArrayRemoveFunction.class).scalar(ArrayElementAtFunction.class).scalar(ArraySortFunction.class).scalar(ArraySortComparatorFunction.class).scalar(ArrayShuffleFunction.class).scalar(ArrayReverseFunction.class).scalar(ArrayMinFunction.class).scalar(ArrayMaxFunction.class).scalar(ArrayDistinctFunction.class).scalar(ArrayIntersectFunction.class).scalar(ArraysOverlapFunction.class).scalar(ArrayUnionFunction.class).scalar(ArrayExceptFunction.class).scalar(ArraySliceFunction.class).scalar(ArrayTrimFunction.class).scalar(ArrayCombinationsFunction.class).scalar(ArrayNgramsFunction.class).scalar(ArrayAllMatchFunction.class).scalar(ArrayAnyMatchFunction.class).scalar(ArrayNoneMatchFunction.class).scalar(MapEntriesFunction.class).scalar(MapFromEntriesFunction.class).scalar(MultimapFromEntriesFunction.class).scalar(MapKeys.class).scalar(MapValues.class).scalar(MapCardinalityFunction.class).scalar(EmptyMapConstructor.class).scalar(TypeOfFunction.class).scalar(TryFunction.class).scalar(ConcatWsFunction.ConcatArrayWs.class).scalar(DynamicFilters.Function.class).scalar(DynamicFilters.NullableFunction.class).functions(ZIP_WITH_FUNCTION, MAP_ZIP_WITH_FUNCTION).functions(ZIP_FUNCTIONS).functions(ARRAY_JOIN, ARRAY_JOIN_WITH_NULL_REPLACEMENT).scalar(ArrayToArrayCast.class).functions(ARRAY_TO_ELEMENT_CONCAT_FUNCTION, ELEMENT_TO_ARRAY_CONCAT_FUNCTION).function(MAP_ELEMENT_AT).function(new MapConcatFunction(blockTypeOperators)).function(new MapToMapCast(blockTypeOperators)).function(ARRAY_FLATTEN_FUNCTION).function(ARRAY_CONCAT_FUNCTION).functions(ARRAY_CONSTRUCTOR, ARRAY_SUBSCRIPT, JSON_TO_ARRAY, JSON_STRING_TO_ARRAY).function(ARRAY_AGG).function(LISTAGG).functions(new MapSubscriptOperator()).functions(MAP_CONSTRUCTOR, JSON_TO_MAP, JSON_STRING_TO_MAP).functions(new MapAggregationFunction(blockTypeOperators), new MapUnionAggregation(blockTypeOperators)).function(REDUCE_AGG).function(new MultimapAggregationFunction(blockTypeOperators)).functions(DECIMAL_TO_VARCHAR_CAST, DECIMAL_TO_INTEGER_CAST, DECIMAL_TO_BIGINT_CAST, DECIMAL_TO_DOUBLE_CAST, DECIMAL_TO_REAL_CAST, DECIMAL_TO_BOOLEAN_CAST, DECIMAL_TO_TINYINT_CAST, DECIMAL_TO_SMALLINT_CAST).functions(VARCHAR_TO_DECIMAL_CAST, INTEGER_TO_DECIMAL_CAST, BIGINT_TO_DECIMAL_CAST, DOUBLE_TO_DECIMAL_CAST, REAL_TO_DECIMAL_CAST, BOOLEAN_TO_DECIMAL_CAST, TINYINT_TO_DECIMAL_CAST, SMALLINT_TO_DECIMAL_CAST).functions(JSON_TO_DECIMAL_CAST, DECIMAL_TO_JSON_CAST).functions(DECIMAL_ADD_OPERATOR, DECIMAL_SUBTRACT_OPERATOR, DECIMAL_MULTIPLY_OPERATOR, DECIMAL_DIVIDE_OPERATOR, DECIMAL_MODULUS_OPERATOR).function(DECIMAL_TO_DECIMAL_SATURATED_FLOOR_CAST).functions(DECIMAL_TO_BIGINT_SATURATED_FLOOR_CAST, BIGINT_TO_DECIMAL_SATURATED_FLOOR_CAST).functions(DECIMAL_TO_INTEGER_SATURATED_FLOOR_CAST, INTEGER_TO_DECIMAL_SATURATED_FLOOR_CAST).functions(DECIMAL_TO_SMALLINT_SATURATED_FLOOR_CAST, SMALLINT_TO_DECIMAL_SATURATED_FLOOR_CAST).functions(DECIMAL_TO_TINYINT_SATURATED_FLOOR_CAST, TINYINT_TO_DECIMAL_SATURATED_FLOOR_CAST).function(new Histogram(blockTypeOperators)).function(new ChecksumAggregationFunction(blockTypeOperators)).function(ARBITRARY_AGGREGATION).functions(GREATEST, LEAST).functions(MAX_BY, MIN_BY, new MaxByNAggregationFunction(blockTypeOperators), new MinByNAggregationFunction(blockTypeOperators)).functions(MAX_AGGREGATION, MIN_AGGREGATION, new MaxNAggregationFunction(blockTypeOperators), new MinNAggregationFunction(blockTypeOperators)).function(COUNT_COLUMN).functions(JSON_TO_ROW, JSON_STRING_TO_ROW, ROW_TO_ROW_CAST).functions(VARCHAR_CONCAT, VARBINARY_CONCAT).function(CONCAT_WS).function(DECIMAL_TO_DECIMAL_CAST).function(castVarcharToRe2JRegexp(featuresConfig.getRe2JDfaStatesLimit(), featuresConfig.getRe2JDfaRetries())).function(castCharToRe2JRegexp(featuresConfig.getRe2JDfaStatesLimit(), featuresConfig.getRe2JDfaRetries())).function(DECIMAL_AVERAGE_AGGREGATION).function(DECIMAL_SUM_AGGREGATION).function(DECIMAL_MOD_FUNCTION).functions(ARRAY_TRANSFORM_FUNCTION, ARRAY_REDUCE_FUNCTION).functions(MAP_FILTER_FUNCTION, new MapTransformKeysFunction(blockTypeOperators), MAP_TRANSFORM_VALUES_FUNCTION).function(FORMAT_FUNCTION).function(TRY_CAST).function(new GenericEqualOperator(typeOperators)).function(new GenericHashCodeOperator(typeOperators)).function(new GenericXxHash64Operator(typeOperators)).function(new GenericDistinctFromOperator(typeOperators)).function(new GenericIndeterminateOperator(typeOperators)).function(new GenericComparisonUnorderedLastOperator(typeOperators)).function(new GenericComparisonUnorderedFirstOperator(typeOperators)).function(new GenericLessThanOperator(typeOperators)).function(new GenericLessThanOrEqualOperator(typeOperators)).function(new VersionFunction(nodeVersion.getVersion())).aggregates(MergeSetDigestAggregation.class).aggregates(BuildSetDigestAggregation.class).scalars(SetDigestFunctions.class).scalars(SetDigestOperators.class).scalars(WilsonInterval.class).aggregates(BigintApproximateMostFrequent.class).aggregates(VarcharApproximateMostFrequent.class);
    // timestamp operators and functions
    builder.scalar(TimestampOperators.TimestampPlusIntervalDayToSecond.class).scalar(TimestampOperators.IntervalDayToSecondPlusTimestamp.class).scalar(TimestampOperators.TimestampPlusIntervalYearToMonth.class).scalar(TimestampOperators.IntervalYearToMonthPlusTimestamp.class).scalar(TimestampOperators.TimestampMinusIntervalDayToSecond.class).scalar(TimestampOperators.TimestampMinusIntervalYearToMonth.class).scalar(TimestampOperators.TimestampMinusTimestamp.class).scalar(TimestampToTimestampCast.class).scalar(TimestampToTimeCast.class).scalar(TimestampToTimeWithTimeZoneCast.class).scalar(TimestampToTimestampWithTimeZoneCast.class).scalar(TimestampToDateCast.class).scalar(TimestampToVarcharCast.class).scalar(TimestampToJsonCast.class).scalar(DateToTimestampCast.class).scalar(TimeToTimestampCast.class).scalar(TimeWithTimeZoneToTimestampCast.class).scalar(TimestampWithTimeZoneToTimestampCast.class).scalar(VarcharToTimestampCast.class).scalar(LocalTimestamp.class).scalar(DateTrunc.class).scalar(HumanReadableSeconds.class).scalar(ToIso8601.class).scalar(WithTimeZone.class).scalar(FormatDateTime.class).scalar(DateFormat.class).scalar(SequenceIntervalYearToMonth.class).scalar(SequenceIntervalDayToSecond.class).scalar(DateAdd.class).scalar(DateDiff.class).scalar(ExtractYear.class).scalar(ExtractQuarter.class).scalar(ExtractMonth.class).scalar(ExtractDay.class).scalar(ExtractHour.class).scalar(ExtractMinute.class).scalar(ExtractSecond.class).scalar(ExtractMillisecond.class).scalar(ExtractDayOfYear.class).scalar(ExtractDayOfWeek.class).scalar(ExtractWeekOfYear.class).scalar(ExtractYearOfWeek.class).scalar(LastDayOfMonth.class);
    // timestamp with timezone operators and functions
    builder.scalar(TimestampWithTimeZoneOperators.TimestampPlusIntervalDayToSecond.class).scalar(TimestampWithTimeZoneOperators.IntervalDayToSecondPlusTimestamp.class).scalar(TimestampWithTimeZoneOperators.TimestampMinusIntervalDayToSecond.class).scalar(TimestampWithTimeZoneOperators.TimestampPlusIntervalYearToMonth.class).scalar(TimestampWithTimeZoneOperators.IntervalYearToMonthPlusTimestamp.class).scalar(TimestampWithTimeZoneOperators.TimestampMinusIntervalYearToMonth.class).scalar(TimestampWithTimeZoneOperators.TimestampMinusTimestamp.class).scalar(CurrentTimestamp.class).scalar(io.trino.operator.scalar.timestamptz.ExtractYear.class).scalar(io.trino.operator.scalar.timestamptz.ExtractQuarter.class).scalar(io.trino.operator.scalar.timestamptz.ExtractMonth.class).scalar(io.trino.operator.scalar.timestamptz.ExtractDay.class).scalar(io.trino.operator.scalar.timestamptz.ExtractHour.class).scalar(io.trino.operator.scalar.timestamptz.ExtractMinute.class).scalar(io.trino.operator.scalar.timestamptz.ExtractSecond.class).scalar(io.trino.operator.scalar.timestamptz.ExtractMillisecond.class).scalar(io.trino.operator.scalar.timestamptz.ExtractDayOfYear.class).scalar(io.trino.operator.scalar.timestamptz.ExtractDayOfWeek.class).scalar(io.trino.operator.scalar.timestamptz.ExtractWeekOfYear.class).scalar(io.trino.operator.scalar.timestamptz.ExtractYearOfWeek.class).scalar(io.trino.operator.scalar.timestamptz.ToIso8601.class).scalar(io.trino.operator.scalar.timestamptz.DateAdd.class).scalar(io.trino.operator.scalar.timestamptz.DateTrunc.class).scalar(io.trino.operator.scalar.timestamptz.TimeZoneHour.class).scalar(io.trino.operator.scalar.timestamptz.TimeZoneMinute.class).scalar(io.trino.operator.scalar.timestamptz.DateDiff.class).scalar(io.trino.operator.scalar.timestamptz.DateFormat.class).scalar(io.trino.operator.scalar.timestamptz.FormatDateTime.class).scalar(io.trino.operator.scalar.timestamptz.ToUnixTime.class).scalar(io.trino.operator.scalar.timestamptz.LastDayOfMonth.class).scalar(AtTimeZone.class).scalar(AtTimeZoneWithOffset.class).scalar(DateToTimestampWithTimeZoneCast.class).scalar(TimestampWithTimeZoneToDateCast.class).scalar(TimestampWithTimeZoneToTimeCast.class).scalar(TimestampWithTimeZoneToTimestampWithTimeZoneCast.class).scalar(TimestampWithTimeZoneToTimeWithTimeZoneCast.class).scalar(TimestampWithTimeZoneToVarcharCast.class).scalar(TimeToTimestampWithTimeZoneCast.class).scalar(TimeWithTimeZoneToTimestampWithTimeZoneCast.class).scalar(VarcharToTimestampWithTimeZoneCast.class);
    // time without time zone functions and operators
    builder.scalar(LocalTimeFunction.class).scalars(TimeOperators.class).scalars(TimeFunctions.class).scalar(TimeToTimeWithTimeZoneCast.class);
    // time with timezone operators and functions
    builder.scalar(TimeWithTimeZoneOperators.TimePlusIntervalDayToSecond.class).scalar(TimeWithTimeZoneOperators.IntervalDayToSecondPlusTime.class).scalar(TimeWithTimeZoneOperators.TimeMinusIntervalDayToSecond.class).scalar(TimeWithTimeZoneOperators.TimeMinusTime.class).scalar(TimeWithTimeZoneToTimeCast.class).scalar(TimeWithTimeZoneToTimeWithTimeZoneCast.class).scalar(TimeWithTimeZoneToVarcharCast.class).scalar(VarcharToTimeWithTimeZoneCast.class).scalar(io.trino.operator.scalar.timetz.DateDiff.class).scalar(io.trino.operator.scalar.timetz.DateAdd.class).scalar(io.trino.operator.scalar.timetz.ExtractHour.class).scalar(io.trino.operator.scalar.timetz.ExtractMinute.class).scalar(io.trino.operator.scalar.timetz.ExtractSecond.class).scalar(io.trino.operator.scalar.timetz.ExtractMillisecond.class).scalar(io.trino.operator.scalar.timetz.TimeZoneHour.class).scalar(io.trino.operator.scalar.timetz.TimeZoneMinute.class).scalar(io.trino.operator.scalar.timetz.DateTrunc.class).scalar(io.trino.operator.scalar.timetz.AtTimeZone.class).scalar(io.trino.operator.scalar.timetz.AtTimeZoneWithOffset.class).scalar(CurrentTime.class);
    switch(featuresConfig.getRegexLibrary()) {
        case JONI:
            builder.scalars(JoniRegexpFunctions.class);
            builder.scalar(JoniRegexpReplaceLambdaFunction.class);
            break;
        case RE2J:
            builder.scalars(Re2JRegexpFunctions.class);
            builder.scalar(Re2JRegexpReplaceLambdaFunction.class);
            break;
    }
    if (featuresConfig.isLegacyRowToJsonCast()) {
        builder.functions(LEGACY_ROW_TO_JSON, LEGACY_ARRAY_TO_JSON, LEGACY_MAP_TO_JSON);
    } else {
        builder.functions(ROW_TO_JSON, ARRAY_TO_JSON, MAP_TO_JSON);
    }
    return builder.build();
}
Also used : CharacterStringCasts(io.trino.operator.scalar.CharacterStringCasts) Histogram(io.trino.operator.aggregation.histogram.Histogram) MapEntriesFunction(io.trino.operator.scalar.MapEntriesFunction) RealGeometricMeanAggregations(io.trino.operator.aggregation.RealGeometricMeanAggregations) MultimapAggregationFunction(io.trino.operator.aggregation.multimapagg.MultimapAggregationFunction) ArraySortFunction(io.trino.operator.scalar.ArraySortFunction) DoubleCovarianceAggregation(io.trino.operator.aggregation.DoubleCovarianceAggregation) ExtractYearOfWeek(io.trino.operator.scalar.timestamp.ExtractYearOfWeek) RealOperators(io.trino.type.RealOperators) ArrayShuffleFunction(io.trino.operator.scalar.ArrayShuffleFunction) GenericIndeterminateOperator(io.trino.operator.scalar.GenericIndeterminateOperator) MathFunctions(io.trino.operator.scalar.MathFunctions) TimeWithTimeZoneToTimestampWithTimeZoneCast(io.trino.operator.scalar.timetz.TimeWithTimeZoneToTimestampWithTimeZoneCast) ArrayContains(io.trino.operator.scalar.ArrayContains) GenericLessThanOrEqualOperator(io.trino.operator.scalar.GenericLessThanOrEqualOperator) IntervalYearToMonthAverageAggregation(io.trino.operator.aggregation.IntervalYearToMonthAverageAggregation) TimestampWithTimeZoneToTimestampCast(io.trino.operator.scalar.timestamptz.TimestampWithTimeZoneToTimestampCast) RepeatFunction(io.trino.operator.scalar.RepeatFunction) TimeWithTimeZoneToVarcharCast(io.trino.operator.scalar.timetz.TimeWithTimeZoneToVarcharCast) IntervalYearToMonthSumAggregation(io.trino.operator.aggregation.IntervalYearToMonthSumAggregation) WordStemFunction(io.trino.operator.scalar.WordStemFunction) VersionFunction(io.trino.operator.scalar.VersionFunction) ColorFunctions(io.trino.operator.scalar.ColorFunctions) ApproximateSetAggregation(io.trino.operator.aggregation.ApproximateSetAggregation) QuantileDigestFunctions(io.trino.operator.scalar.QuantileDigestFunctions) BooleanOperators(io.trino.type.BooleanOperators) BitwiseFunctions(io.trino.operator.scalar.BitwiseFunctions) ApproximateRealPercentileArrayAggregations(io.trino.operator.aggregation.ApproximateRealPercentileArrayAggregations) DoubleRegressionAggregation(io.trino.operator.aggregation.DoubleRegressionAggregation) ExtractDayOfWeek(io.trino.operator.scalar.timestamp.ExtractDayOfWeek) GenericLessThanOperator(io.trino.operator.scalar.GenericLessThanOperator) SessionFunctions(io.trino.operator.scalar.SessionFunctions) MaxByNAggregationFunction(io.trino.operator.aggregation.minmaxby.MaxByNAggregationFunction) HyperLogLogOperators(io.trino.type.HyperLogLogOperators) ConcatWsFunction(io.trino.operator.scalar.ConcatWsFunction) DoubleHistogramAggregation(io.trino.operator.aggregation.DoubleHistogramAggregation) LegacyApproximateRealPercentileAggregations(io.trino.operator.aggregation.LegacyApproximateRealPercentileAggregations) ApproximateRealPercentileAggregations(io.trino.operator.aggregation.ApproximateRealPercentileAggregations) DoubleSumAggregation(io.trino.operator.aggregation.DoubleSumAggregation) ExtractMillisecond(io.trino.operator.scalar.timestamp.ExtractMillisecond) ChecksumAggregationFunction(io.trino.operator.aggregation.ChecksumAggregationFunction) TimeToTimestampCast(io.trino.operator.scalar.time.TimeToTimestampCast) TimestampToDateCast(io.trino.operator.scalar.timestamp.TimestampToDateCast) TinyintOperators(io.trino.type.TinyintOperators) SetDigestOperators(io.trino.type.setdigest.SetDigestOperators) VarianceAggregation(io.trino.operator.aggregation.VarianceAggregation) ApproximateLongPercentileArrayAggregations(io.trino.operator.aggregation.ApproximateLongPercentileArrayAggregations) CurrentTimestamp(io.trino.operator.scalar.timestamptz.CurrentTimestamp) DynamicFilters(io.trino.sql.DynamicFilters) WithTimeZone(io.trino.operator.scalar.timestamp.WithTimeZone) LastDayOfMonth(io.trino.operator.scalar.timestamp.LastDayOfMonth) CombineHashFunction(io.trino.operator.scalar.CombineHashFunction) InternalFunctionBundleBuilder(io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder) GenericDistinctFromOperator(io.trino.operator.scalar.GenericDistinctFromOperator) DateDiff(io.trino.operator.scalar.timestamp.DateDiff) TimestampWithTimeZoneToDateCast(io.trino.operator.scalar.timestamptz.TimestampWithTimeZoneToDateCast) ArrayFilterFunction(io.trino.operator.scalar.ArrayFilterFunction) DateOperators(io.trino.type.DateOperators) MultimapFromEntriesFunction(io.trino.operator.scalar.MultimapFromEntriesFunction) FormatNumberFunction(io.trino.operator.scalar.FormatNumberFunction) GenericHashCodeOperator(io.trino.operator.scalar.GenericHashCodeOperator) TimeFunctions(io.trino.operator.scalar.time.TimeFunctions) DateTimeFunctions(io.trino.operator.scalar.DateTimeFunctions) TimestampOperators(io.trino.operator.scalar.timestamp.TimestampOperators) ArrayRemoveFunction(io.trino.operator.scalar.ArrayRemoveFunction) RowNumberFunction(io.trino.operator.window.RowNumberFunction) EmptyMapConstructor(io.trino.operator.scalar.EmptyMapConstructor) ApproximateLongPercentileAggregations(io.trino.operator.aggregation.ApproximateLongPercentileAggregations) LegacyApproximateLongPercentileAggregations(io.trino.operator.aggregation.LegacyApproximateLongPercentileAggregations) ExtractMinute(io.trino.operator.scalar.timestamp.ExtractMinute) TDigestAggregationFunction(io.trino.operator.aggregation.TDigestAggregationFunction) DateFormat(io.trino.operator.scalar.timestamp.DateFormat) FailureFunction(io.trino.operator.scalar.FailureFunction) DateTrunc(io.trino.operator.scalar.timestamp.DateTrunc) ArraysOverlapFunction(io.trino.operator.scalar.ArraysOverlapFunction) ArrayDistinctFunction(io.trino.operator.scalar.ArrayDistinctFunction) BuildSetDigestAggregation(io.trino.type.setdigest.BuildSetDigestAggregation) TDigestOperators(io.trino.type.TDigestOperators) GenericComparisonUnorderedFirstOperator(io.trino.operator.scalar.GenericComparisonUnorderedFirstOperator) SequenceIntervalDayToSecond(io.trino.operator.scalar.timestamp.SequenceIntervalDayToSecond) ExtractSecond(io.trino.operator.scalar.timestamp.ExtractSecond) MapValues(io.trino.operator.scalar.MapValues) MapConcatFunction(io.trino.operator.scalar.MapConcatFunction) MapAggregationFunction(io.trino.operator.aggregation.MapAggregationFunction) TimeWithTimeZoneToTimeCast(io.trino.operator.scalar.timetz.TimeWithTimeZoneToTimeCast) TimestampWithTimeZoneToVarcharCast(io.trino.operator.scalar.timestamptz.TimestampWithTimeZoneToVarcharCast) TimestampToJsonCast(io.trino.operator.scalar.timestamp.TimestampToJsonCast) BooleanAndAggregation(io.trino.operator.aggregation.BooleanAndAggregation) ArrayTrimFunction(io.trino.operator.scalar.ArrayTrimFunction) FirstValueFunction(io.trino.operator.window.FirstValueFunction) GenericXxHash64Operator(io.trino.operator.scalar.GenericXxHash64Operator) BooleanDefaultApproximateCountDistinctAggregation(io.trino.operator.aggregation.BooleanDefaultApproximateCountDistinctAggregation) AtTimeZoneWithOffset(io.trino.operator.scalar.timestamptz.AtTimeZoneWithOffset) FormatDateTime(io.trino.operator.scalar.timestamp.FormatDateTime) TimestampWithTimeZoneToTimestampWithTimeZoneCast(io.trino.operator.scalar.timestamptz.TimestampWithTimeZoneToTimestampWithTimeZoneCast) MinByNAggregationFunction(io.trino.operator.aggregation.minmaxby.MinByNAggregationFunction) TimeWithTimeZoneOperators(io.trino.operator.scalar.timetz.TimeWithTimeZoneOperators) LocalTimestamp(io.trino.operator.scalar.timestamp.LocalTimestamp) CumulativeDistributionFunction(io.trino.operator.window.CumulativeDistributionFunction) LongSumAggregation(io.trino.operator.aggregation.LongSumAggregation) MapToMapCast(io.trino.operator.scalar.MapToMapCast) ArrayAnyMatchFunction(io.trino.operator.scalar.ArrayAnyMatchFunction) DoubleCorrelationAggregation(io.trino.operator.aggregation.DoubleCorrelationAggregation) BitwiseOrAggregation(io.trino.operator.aggregation.BitwiseOrAggregation) LikeFunctions(io.trino.type.LikeFunctions) LeadFunction(io.trino.operator.window.LeadFunction) NthValueFunction(io.trino.operator.window.NthValueFunction) TimestampToTimestampCast(io.trino.operator.scalar.timestamp.TimestampToTimestampCast) IntervalYearMonthOperators(io.trino.type.IntervalYearMonthOperators) HmacFunctions(io.trino.operator.scalar.HmacFunctions) ArrayMinFunction(io.trino.operator.scalar.ArrayMinFunction) SplitToMultimapFunction(io.trino.operator.scalar.SplitToMultimapFunction) ArrayNgramsFunction(io.trino.operator.scalar.ArrayNgramsFunction) DateAdd(io.trino.operator.scalar.timestamp.DateAdd) Re2JRegexpReplaceLambdaFunction(io.trino.operator.scalar.Re2JRegexpReplaceLambdaFunction) ArrayAnyMatchFunction(io.trino.operator.scalar.ArrayAnyMatchFunction) ConcatWsFunction(io.trino.operator.scalar.ConcatWsFunction) ArrayPositionFunction(io.trino.operator.scalar.ArrayPositionFunction) LastValueFunction(io.trino.operator.window.LastValueFunction) FormatNumberFunction(io.trino.operator.scalar.FormatNumberFunction) ArrayNoneMatchFunction(io.trino.operator.scalar.ArrayNoneMatchFunction) ArraySliceFunction(io.trino.operator.scalar.ArraySliceFunction) ArrayUnionFunction(io.trino.operator.scalar.ArrayUnionFunction) VersionFunction(io.trino.operator.scalar.VersionFunction) MultimapFromEntriesFunction(io.trino.operator.scalar.MultimapFromEntriesFunction) ArraySortFunction(io.trino.operator.scalar.ArraySortFunction) MultimapAggregationFunction(io.trino.operator.aggregation.multimapagg.MultimapAggregationFunction) ArrayAllMatchFunction(io.trino.operator.scalar.ArrayAllMatchFunction) MaxByNAggregationFunction(io.trino.operator.aggregation.minmaxby.MaxByNAggregationFunction) LagFunction(io.trino.operator.window.LagFunction) MinNAggregationFunction(io.trino.operator.aggregation.MinNAggregationFunction) RowNumberFunction(io.trino.operator.window.RowNumberFunction) TryFunction(io.trino.operator.scalar.TryFunction) SplitToMultimapFunction(io.trino.operator.scalar.SplitToMultimapFunction) SequenceFunction(io.trino.operator.scalar.SequenceFunction) MapCardinalityFunction(io.trino.operator.scalar.MapCardinalityFunction) LuhnCheckFunction(io.trino.operator.scalar.LuhnCheckFunction) ArrayShuffleFunction(io.trino.operator.scalar.ArrayShuffleFunction) RankFunction(io.trino.operator.window.RankFunction) MaxNAggregationFunction(io.trino.operator.aggregation.MaxNAggregationFunction) ArrayTrimFunction(io.trino.operator.scalar.ArrayTrimFunction) MapFromEntriesFunction(io.trino.operator.scalar.MapFromEntriesFunction) ArrayIntersectFunction(io.trino.operator.scalar.ArrayIntersectFunction) FailureFunction(io.trino.operator.scalar.FailureFunction) ArrayRemoveFunction(io.trino.operator.scalar.ArrayRemoveFunction) ArraySortComparatorFunction(io.trino.operator.scalar.ArraySortComparatorFunction) ArrayNgramsFunction(io.trino.operator.scalar.ArrayNgramsFunction) WordStemFunction(io.trino.operator.scalar.WordStemFunction) RepeatFunction(io.trino.operator.scalar.RepeatFunction) CumulativeDistributionFunction(io.trino.operator.window.CumulativeDistributionFunction) ArrayFilterFunction(io.trino.operator.scalar.ArrayFilterFunction) NTileFunction(io.trino.operator.window.NTileFunction) LocalTimeFunction(io.trino.operator.scalar.time.LocalTimeFunction) ArrayDistinctFunction(io.trino.operator.scalar.ArrayDistinctFunction) ArrayCardinalityFunction(io.trino.operator.scalar.ArrayCardinalityFunction) SplitToMapFunction(io.trino.operator.scalar.SplitToMapFunction) ArrayMinFunction(io.trino.operator.scalar.ArrayMinFunction) ChecksumAggregationFunction(io.trino.operator.aggregation.ChecksumAggregationFunction) MapEntriesFunction(io.trino.operator.scalar.MapEntriesFunction) DenseRankFunction(io.trino.operator.window.DenseRankFunction) ArrayExceptFunction(io.trino.operator.scalar.ArrayExceptFunction) TDigestAggregationFunction(io.trino.operator.aggregation.TDigestAggregationFunction) JoniRegexpReplaceLambdaFunction(io.trino.operator.scalar.JoniRegexpReplaceLambdaFunction) NthValueFunction(io.trino.operator.window.NthValueFunction) CombineHashFunction(io.trino.operator.scalar.CombineHashFunction) MapTransformKeysFunction(io.trino.operator.scalar.MapTransformKeysFunction) PercentRankFunction(io.trino.operator.window.PercentRankFunction) ArrayReverseFunction(io.trino.operator.scalar.ArrayReverseFunction) MapConcatFunction(io.trino.operator.scalar.MapConcatFunction) ArraysOverlapFunction(io.trino.operator.scalar.ArraysOverlapFunction) TypeOfFunction(io.trino.operator.scalar.TypeOfFunction) MinByNAggregationFunction(io.trino.operator.aggregation.minmaxby.MinByNAggregationFunction) ArrayCombinationsFunction(io.trino.operator.scalar.ArrayCombinationsFunction) MapAggregationFunction(io.trino.operator.aggregation.MapAggregationFunction) ArrayMaxFunction(io.trino.operator.scalar.ArrayMaxFunction) LeadFunction(io.trino.operator.window.LeadFunction) MergeQuantileDigestFunction(io.trino.operator.aggregation.MergeQuantileDigestFunction) ArrayElementAtFunction(io.trino.operator.scalar.ArrayElementAtFunction) FirstValueFunction(io.trino.operator.window.FirstValueFunction) TryFunction(io.trino.operator.scalar.TryFunction) MapUnionAggregation(io.trino.operator.aggregation.MapUnionAggregation) IntegerOperators(io.trino.type.IntegerOperators) MapSubscriptOperator(io.trino.operator.scalar.MapSubscriptOperator) MapTransformKeysFunction(io.trino.operator.scalar.MapTransformKeysFunction) GenericComparisonUnorderedLastOperator(io.trino.operator.scalar.GenericComparisonUnorderedLastOperator) HumanReadableSeconds(io.trino.operator.scalar.timestamp.HumanReadableSeconds) ExtractQuarter(io.trino.operator.scalar.timestamp.ExtractQuarter) DenseRankFunction(io.trino.operator.window.DenseRankFunction) TimestampToTimeWithTimeZoneCast(io.trino.operator.scalar.timestamp.TimestampToTimeWithTimeZoneCast) ExtractDay(io.trino.operator.scalar.timestamp.ExtractDay) IpAddressFunctions(io.trino.operator.scalar.IpAddressFunctions) LegacyApproximateDoublePercentileAggregations(io.trino.operator.aggregation.LegacyApproximateDoublePercentileAggregations) MinNAggregationFunction(io.trino.operator.aggregation.MinNAggregationFunction) DefaultApproximateCountDistinctAggregation(io.trino.operator.aggregation.DefaultApproximateCountDistinctAggregation) BooleanDefaultApproximateCountDistinctAggregation(io.trino.operator.aggregation.BooleanDefaultApproximateCountDistinctAggregation) MaxDataSizeForStats(io.trino.operator.aggregation.MaxDataSizeForStats) UrlFunctions(io.trino.operator.scalar.UrlFunctions) ArrayExceptFunction(io.trino.operator.scalar.ArrayExceptFunction) TimestampWithTimeZoneOperators(io.trino.operator.scalar.timestamptz.TimestampWithTimeZoneOperators) LocalTimeFunction(io.trino.operator.scalar.time.LocalTimeFunction) BigintApproximateMostFrequent(io.trino.operator.aggregation.BigintApproximateMostFrequent) ExtractHour(io.trino.operator.scalar.timestamp.ExtractHour) MaxNAggregationFunction(io.trino.operator.aggregation.MaxNAggregationFunction) GenericEqualOperator(io.trino.operator.scalar.GenericEqualOperator)

Aggregations

InternalFunctionBundleBuilder (io.trino.metadata.InternalFunctionBundle.InternalFunctionBundleBuilder)3 ApproximateLongPercentileAggregations (io.trino.operator.aggregation.ApproximateLongPercentileAggregations)1 ApproximateLongPercentileArrayAggregations (io.trino.operator.aggregation.ApproximateLongPercentileArrayAggregations)1 ApproximateRealPercentileAggregations (io.trino.operator.aggregation.ApproximateRealPercentileAggregations)1 ApproximateRealPercentileArrayAggregations (io.trino.operator.aggregation.ApproximateRealPercentileArrayAggregations)1 ApproximateSetAggregation (io.trino.operator.aggregation.ApproximateSetAggregation)1 BigintApproximateMostFrequent (io.trino.operator.aggregation.BigintApproximateMostFrequent)1 BitwiseOrAggregation (io.trino.operator.aggregation.BitwiseOrAggregation)1 BooleanAndAggregation (io.trino.operator.aggregation.BooleanAndAggregation)1 BooleanDefaultApproximateCountDistinctAggregation (io.trino.operator.aggregation.BooleanDefaultApproximateCountDistinctAggregation)1 ChecksumAggregationFunction (io.trino.operator.aggregation.ChecksumAggregationFunction)1 DefaultApproximateCountDistinctAggregation (io.trino.operator.aggregation.DefaultApproximateCountDistinctAggregation)1 DoubleCorrelationAggregation (io.trino.operator.aggregation.DoubleCorrelationAggregation)1 DoubleCovarianceAggregation (io.trino.operator.aggregation.DoubleCovarianceAggregation)1 DoubleHistogramAggregation (io.trino.operator.aggregation.DoubleHistogramAggregation)1 DoubleRegressionAggregation (io.trino.operator.aggregation.DoubleRegressionAggregation)1 DoubleSumAggregation (io.trino.operator.aggregation.DoubleSumAggregation)1 IntervalYearToMonthAverageAggregation (io.trino.operator.aggregation.IntervalYearToMonthAverageAggregation)1 IntervalYearToMonthSumAggregation (io.trino.operator.aggregation.IntervalYearToMonthSumAggregation)1 LegacyApproximateDoublePercentileAggregations (io.trino.operator.aggregation.LegacyApproximateDoublePercentileAggregations)1