class CurrentSettingFunction extends Scalar<String, Object> {

    private static final String NAME = "current_setting";
    private static final FunctionName FQN = new FunctionName(PgCatalogSchemaInfo.NAME, NAME);

    public static void register(Functions.Builder builder, SessionSettingRegistry sessionSettingRegistry) {
        builder.add(
            scalar(
                FQN,
                DataTypes.STRING.getTypeSignature(),
                DataTypes.STRING.getTypeSignature()
            ).withFeature(Feature.NULLABLE),
            (signature, boundSignature) ->
                new CurrentSettingFunction(
                    signature,
                    boundSignature,
                    sessionSettingRegistry
                )
        );

        builder.add(
            scalar(
                FQN,
                DataTypes.STRING.getTypeSignature(),
                DataTypes.BOOLEAN.getTypeSignature(),
                DataTypes.STRING.getTypeSignature()
            ).withFeature(Feature.NULLABLE),
            (signature, boundSignature) ->
                new CurrentSettingFunction(
                    signature,
                    boundSignature,
                    sessionSettingRegistry
                )
        );
    }

    private final SessionSettingRegistry sessionSettingRegistry;

    CurrentSettingFunction(Signature signature, BoundSignature boundSignature, SessionSettingRegistry sessionSettingRegistry) {
        super(signature, boundSignature);
        this.sessionSettingRegistry = sessionSettingRegistry;

    }

    @Override
    public String evaluate(TransactionContext txnCtx, NodeContext nodeCtx, Input<Object>... args) {<FILL_FUNCTION_BODY>}
}

        assert args.length == 1 || args.length == 2 : "number of args must be 1 or 2";

        final String settingName = (String) args[0].value();
        if (settingName == null) {
            return null;
        }

        final Boolean missingOk = (args.length == 2)
            ? (Boolean) args[1].value()
            : Boolean.FALSE;
        if (missingOk == null) {
            return null;
        }

        final SessionSetting<?> sessionSetting = sessionSettingRegistry.settings().get(settingName);
        if (sessionSetting == null) {
            if (missingOk) {
                return null;
            } else {
                throw new IllegalArgumentException("Unrecognised Setting: " + settingName);
            }
        }
        return sessionSetting.getValue(txnCtx.sessionSettings());
    
<methods>public BoundSignature boundSignature() ,public Scalar<java.lang.String,java.lang.Object> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract java.lang.String evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<java.lang.Object>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature