You can put your code enclosed by three starting (```) backticks and three ending same backticks. This will help to keep same indentation as in code while posting. For more, you can read here:
This can help you properly format your writing here in hive as well. I hope you will find it useful.