Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4740

JDBC adapter generates incorrect HAVING clause in BigQuery dialect

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.27.0
    • 1.28.0
    • core
    • jdk8

      macos

    Description

      I'm convertingĀ 

      String query = select
       "product_id" ,  sum("shelf_width")
      from "foodmart"."product"
      where "product_id" > 0
      group by "product_id" having sum("shelf_width") > 1

      with big query dialect, but results

      SELECT product_id, SUM(shelf_width)
      FROM foodmart.product
      WHERE product_id > 0
      GROUP BY product_id
      HAVING `EXPR$1` > 1
      

      Maybe we need replace having clause aliases when stripping trivial aliases.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            yanjing.wang yanjing.wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment