Halve and pit all 24 apricots, then place them in a large bowl. Add the sugar, flour, salt, and vanilla extract, stirring gently to coat the apricots evenly. Let this mixture sit for 30 minutes at room temperature—this allows the apricots to release their juices and the sugar to dissolve, creating a beautiful filling that won't be dry. While the filling rests, preheat your oven to 425°F and place a sheet of foil on the bottom rack to catch any drips.
Remove one disc of chilled pie dough from the refrigerator and fit it gently into your pie plate, allowing the edges to hang slightly over the rim. Keep the second dough disc chilled until you're ready to top the pie. I like to work quickly with cold dough to maintain the flaky texture, so have everything else ready before you start.
Pour the apricot filling from Step 1 into the prepared pie crust, then dot the top with the butter cut into small pieces. Remove the second dough disc from the refrigerator and place it over the filling. Press the edges of both dough layers together firmly to seal, then trim any excess dough with a knife. Using a sharp knife or small knife tip, cut 3-4 slits in the top crust to allow steam to escape during baking.
Brush the beaten egg yolk mixture evenly over the top crust using a pastry brush, creating a light, even coating. Immediately sprinkle the sparkling sugar over the egg wash while it's still wet so it adheres properly and creates a beautiful, crunchy topping. The egg wash will also give your pie a professional golden-brown finish.
Place the pie in the preheated 425°F oven and bake for 15 minutes to set the crust and start cooking the filling. After 15 minutes, reduce the oven temperature to 350°F and continue baking for approximately 1 hour, until the filling is bubbling at the edges and the top is golden brown. If the crust edges begin to brown too quickly during the second phase, cover them loosely with foil to protect them. The pie is done when you can see the fruit mixture bubbling around the edges and the top crust is deeply golden.