Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7878

Bad SQL generated by compute incremental stats

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Frontend
    • None
    • ghx-label-9

    Description

      Computing incremental stats on partitions generates bad sql for instance:
      For a table foo partitioned by column bar, the compute stats statement:

      compute incremental stats foo partition (bar = 1); 
      

      would generate the following query:

      SELECT COUNT(*), month FROM foo WHERE (bar=1) GROUP BY bar;
      

      If this were to be rewritten as follows, it would produce fewer fragments and hence also reduce query memory by avoiding a hash aggregation node.

      SELECT COUNT(*), 1 FROM foo WHERE bar=1; 
      

      Attachments

        Activity

          People

            fangyurao Fang-Yu Rao
            poojanilangekar Pooja Nilangekar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: