class SubscriptFunctions {

    public static Function makeObjectSubscript(Symbol base, List<String> path) {
        assert base.valueType().id() == ObjectType.ID
            : "makeObjectSubscript only works on base symbols of type `object`, got `" + base.valueType().getName() + '`';
        List<Symbol> arguments = Lists.mapTail(base, path, Literal::of);
        DataType<?> returnType = ((ObjectType) base.valueType()).resolveInnerType(path);
        return new Function(
            SubscriptObjectFunction.SIGNATURE,
            arguments,
            returnType
        );
    }

    public static Function makeObjectSubscript(Symbol base, ColumnIdent column) {
        return makeObjectSubscript(base, column.path());
    }

    @Nullable
    public static Function tryCreateSubscript(Symbol baseSymbol, List<String> path) {<FILL_FUNCTION_BODY>}
}

        assert !path.isEmpty() : "Path must not be empty to create subscript function";

        var baseType = baseSymbol.valueType();
        switch (baseType.id()) {
            case ObjectType.ID: {
                List<Symbol> arguments = Lists.mapTail(baseSymbol, path, Literal::of);
                DataType<?> returnType = ((ObjectType) baseType).resolveInnerType(path);
                return new Function(
                    SubscriptObjectFunction.SIGNATURE,
                    arguments,
                    returnType
                );
            }

            case RowType.ID: {
                String child = path.get(0);
                RowType rowType = (RowType) baseType;
                int idx = rowType.fieldNames().indexOf(child);
                if (idx < 0) {
                    return null;
                }
                Function recordSubscript = new Function(
                    SubscriptRecordFunction.SIGNATURE,
                    List.of(baseSymbol, Literal.of(child)),
                    rowType.getFieldType(idx)
                );
                if (path.size() > 1) {
                    return tryCreateSubscript(recordSubscript, path.subList(1, path.size()));
                }
                return recordSubscript;
            }

            default:
                return null;
        }
    
<no_super_class>