Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-18107

Insert overwrite statement runs much slower in spark-sql than it does in hive-client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • SQL
    • None
    • spark 2.0.0
      hive 2.0.1

    Description

      I find insert overwrite statement running in spark-sql or spark-shell spends much more time than it does in hive-client (i start it in apache-hive-2.0.1-bin/bin/hive ), where spark costs about ten minutes but hive-client just costs less than 20 seconds.

      These are the steps I took.

      Test sql is :

      insert overwrite table login4game partition(pt='mix_en',dt='2016-10-21') select distinct account_name,role_id,server,'1476979200' as recdate, 'mix' as platform, 'mix' as pid, 'mix' as dev from tbllog_login where pt='mix_en' and dt='2016-10-21' ;

      there are 257128 lines of data in tbllog_login with partition(pt='mix_en',dt='2016-10-21')

      ps:

      I'm sure it must be "insert overwrite" costing a lot of time in spark, may be when doing overwrite, it need to spend a lot of time in io or in something else.

      I also compare the executing time between insert overwrite statement and insert into statement.

      1. insert overwrite statement and insert into statement in spark:

      insert overwrite statement costs about 10 minutes
      insert into statement costs about 30 seconds

      2. insert into statement in spark and insert into statement in hive-client:

      spark costs about 30 seconds
      hive-client costs about 20 seconds
      the difference is little that we can ignore

      Attachments

        Activity

          People

            viirya L. C. Hsieh
            snodawn snodawn
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: