Preheat oven to 350 degrees F. Butter a 9-inch round by 3-inch deep cake pan (preferably with a removable bottom) or 9-inch square cake pan; line bottom with parchment paper.
In a mixing bowl or the bowl of a stand mixer fitted with the paddle attachment, cream butter and sugar together until fluffy, 2 to 3 minutes.
Add eggs, one at a time, mixing well after each addition.
Mix baking soda in with sour cream; mix baking powder and salt in with flour until evenly incorporated.
Alternate adding half of sour cream to batter, followed by half of dry ingredients, mixing well after each addition.
Scrape down the sides of the bowl, then repeat with remaining sour cream and flour until just incorporated.
Mix in vanilla extract, then fold in apples until evenly distributed.
In a small bowl, whisk together sugar and cinnamon.
Spread half of the batter into prepared cake pan.
Sprinkle with half of sugar mixture and half of chopped nuts; gently swirl a few strokes through the batter with a knife.
Top with remaining batter, then sprinkle with remaining sugar and nuts and swirl once again.
Bake for about 50 minutes or until top is golden brown and a toothpick inserted near the center comes out clean.
If using a 9-inch square pan or a smaller pan, start checking after 30-35 minutes.
Place pan on a wire rack to cool.
Run a knife around the edge to release, then remove from pan and cool completely.
Cake will keep, covered in an airtight container, for up to 3 days.
