class RerouteOptionVisitor extends AstVisitor<RerouteAnalyzedStatement, Context> {

        @Override
        public RerouteAnalyzedStatement visitRerouteMoveShard(RerouteMoveShard<?> node, Context context) {
            return new AnalyzedRerouteMoveShard(
                context.tableInfo,
                Lists.map(
                    context.partitionProperties,
                    p -> p.map(a -> context.exprAnalyzerWithFields.convert(a, context.exprCtx))
                ),
                node.map(x -> context.exprAnalyzer.convert((Expression) x, context.exprCtx))
            );
        }

        @Override
        public RerouteAnalyzedStatement visitRerouteAllocateReplicaShard(RerouteAllocateReplicaShard<?> node,
                                                                         Context context) {
            return new AnalyzedRerouteAllocateReplicaShard(
                context.tableInfo,
                Lists.map(
                    context.partitionProperties,
                    p -> p.map(a -> context.exprAnalyzerWithFields.convert(a, context.exprCtx))
                ),
                node.map(x -> context.exprAnalyzer.convert((Expression) x, context.exprCtx))
            );
        }

        @Override
        public RerouteAnalyzedStatement visitRerouteCancelShard(RerouteCancelShard<?> node, Context context) {
            return new AnalyzedRerouteCancelShard(
                context.tableInfo,
                Lists.map(
                    context.partitionProperties,
                    p -> p.map(a -> context.exprAnalyzerWithFields.convert(a, context.exprCtx))
                ),
                node.map(x -> context.exprAnalyzer.convert((Expression) x, context.exprCtx))
            );
        }

        @Override
        public RerouteAnalyzedStatement visitReroutePromoteReplica(PromoteReplica<?> node, Context context) {<FILL_FUNCTION_BODY>}
    }

            var promoteReplica = node.map(x -> context.exprAnalyzer.convert((Expression) x, context.exprCtx));

            HashMap<String, Symbol> properties = new HashMap<>(promoteReplica.properties().properties());
            Symbol acceptDataLoss = properties.remove(PromoteReplica.Properties.ACCEPT_DATA_LOSS);
            if (!properties.isEmpty()) {
                throw new IllegalArgumentException(
                    "Unsupported options provided to REROUTE PROMOTE REPLICA: " + properties.keySet());
            }

            return new AnalyzedPromoteReplica(
                context.tableInfo,
                Lists.map(
                    context.partitionProperties,
                    p -> p.map(a -> context.exprAnalyzerWithFields.convert(a, context.exprCtx))
                ),
                node.map(x -> context.exprAnalyzer.convert((Expression) x, context.exprCtx)),
                acceptDataLoss == null ? Literal.BOOLEAN_FALSE : acceptDataLoss
            );
        
<no_super_class>