Hive
  1. Hive
  2. HIVE-3005

Skip execution phase for queries that contain "LIMIT 0" clause

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None

      Activity

      Hide
      Carl Steinbach added a comment -

      Executing a query that contains a "LIMIT 0" clause is a trick that some clients (e.g. ODBC clients) employ in order to generate a result set without incurring the cost of actually executing the query. Unfortunately, this trick doesn't work with Hive:

      hive> SELECT key FROM SRC LIMIT 0;
      SELECT key FROM SRC LIMIT 0;
      Total MapReduce jobs = 1
      Launching Job 1 out of 1
      Number of reduce tasks is set to 0 since there's no reduce operator
      Execution log at: /tmp/carl/carl_20120505182828_a5405bcb-c156-4572-b2d8-eda2cc199a14.log
      Job running in-process (local Hadoop)
      Hadoop job information for null: number of mappers: 0; number of reducers: 0
      2012-05-05 18:28:35,999 null map = 100%,  reduce = 0%
      Ended Job = job_local_0001
      Execution completed successfully
      Mapred Local Task Succeeded . Convert the Join into MapJoin
      OK
      
      Show
      Carl Steinbach added a comment - Executing a query that contains a "LIMIT 0" clause is a trick that some clients (e.g. ODBC clients) employ in order to generate a result set without incurring the cost of actually executing the query. Unfortunately, this trick doesn't work with Hive: hive> SELECT key FROM SRC LIMIT 0; SELECT key FROM SRC LIMIT 0; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Execution log at: /tmp/carl/carl_20120505182828_a5405bcb-c156-4572-b2d8-eda2cc199a14.log Job running in-process (local Hadoop) Hadoop job information for null: number of mappers: 0; number of reducers: 0 2012-05-05 18:28:35,999 null map = 100%, reduce = 0% Ended Job = job_local_0001 Execution completed successfully Mapred Local Task Succeeded . Convert the Join into MapJoin OK

        People

        • Assignee:
          Shreepadma Venugopalan
          Reporter:
          Carl Steinbach
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:

            Development