The INSERT...SELECT operation needs to be optimized if any of the following conditions is true:
Optimize the INSERT...SELECT operation as follows:
In Beeline/JDBCServer mode, the executor user is the same as the driver user. The driver user is a spark user because the driver is a part of JDBCServer service and started by a spark user. If the Beeline user is not a spark user, the file owner must be changed to the Beeline user (actual user) because the executor is unaware of the Beeline user.
The preceding optimizations are not a one-size-fits-all solution. In the following scenario, it still takes long to perform the INSERT...SELECT operation:
The dynamic partitioned table contains many partitions.