Hive
  1. Hive
  2. HIVE-6448

Java heap space pasring a query with many union all

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.11.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      too many union all statements in a single query require massive amount of memory to process.
      Under default HiveServer Xmx (256) we can run ~50 union alls.
      It seems to be rather linear as increasing the Xmx to 1024 we can run ~200.
      The error is :

      java.lang.OutOfMemoryError: Java heap space
      at java.util.Arrays.copyOf(Arrays.java:2882)
      at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
      at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
      at java.lang.StringBuilder.append(StringBuilder.java:119)
      at org.apache.hadoop.hive.ql.QueryPlan.getJSONKeyValue(QueryPlan.java:453)
      at org.apache.hadoop.hive.ql.QueryPlan.getJSONQuery(QueryPlan.java:598)
      at org.apache.hadoop.hive.ql.QueryPlan.toString(QueryPlan.java:609)
      at org.apache.hadoop.hive.ql.history.HiveHistory.logPlanProgress(HiveHistory.java:499)
      at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:136)
      at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
      at org.apache.hadoop.hive.ql.exec.TaskRunner.run(TaskRunner.java:47)

      Query example :
      select *
      from (
      select count( * ) from default.dual union all
      select count ( * ) from default.dual union all
      ......
      select count( * ) from default.dual) z

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            dima machlin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development