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

SQLBuilder.toSQL is broken when there is a sort by after having

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:

      Description

      parse this SQL "SELECT COUNT(value) FROM parquet_t1 GROUP BY key HAVING MAX(key) > 0 SORT BY key" to logical plan and generate SQL string again, the generated SQL string can't be parsed.

      This is because, we will add extra `SubqueryAlias` while converting logical plan to SQL string(the `RecoverScopingInfo` rule in SQLBuilder). However, we only update qualifiers in the `Project` operator that just above the added `SubqueryAlias`, logically we also need to update qualifiers in all ancestor plans. For example, if there is a Project under a Sort, if we add `SubqueryAlias` under Project, we need update qualifiers for Sort too.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cloud_fan Wenchen Fan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: