OR Statement in JOIN Query Conditions Causes Slow Hive SQL Execution
Symptom
If there is an OR statement in JOIN statement of Hive SQL in MRS 3.2.0-LTS or later, the SQL task runs slowly. In extreme cases, column concatenation may occur (in MRS 3.6.0-LTS.1 or later). The following is an example of the SQL statement:
Cause Analysis
If there is an OR statement in the JOIN ON condition of Hive SQL, the Cartesian product is generated during the JOIN operation because there is no JOIN key. You can confirm this problem in the execution plan. For example, the task of the SQL JOIN statement in Figure 2 has no key value.
Procedure
Modify Hive SQL statements. You can replace the OR statement with the UNION or UNION ALL statement based on the site requirements.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
