In a bowl, mix the flour, semolina, baking powder, cinnamon, and cloves. Add the coarsely ground walnuts and mix well. Beat the eggs for 2-3 minutes until they start to foam, then add the sugar and beat until the mixture becomes creamy, about 5 minutes. Lower the mixer speed and add the cognac and sunflower oil. Gradually add half of the flour mixture, spoon by spoon. Add the milk and the rest of the flour mixture, mixing well.
Grease a rectangular pan (23x33 cm) and pour in the walnut pie mixture. Let it sit for 30 minutes to allow the semolina to expand.
Preheat the oven to 180°C (356°F) and bake the walnut pie for 40 minutes.
After 20 minutes of baking, prepare the syrup: combine all the syrup ingredients in a saucepan, mix well, and bring to a boil. Once the sugar dissolves and the water boils, reduce the heat and simmer for 5 minutes.
Remove the walnut pie from the oven and spoon the hot syrup over it. Allow the dessert to sit for 2-3 hours to absorb the syrup and cool completely.
Serve the walnut pie with a scoop of ice cream and, if desired, sprinkle with freshly ground cinnamon.