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

Support an outer outer context in subquery resolution

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5.0
    • None
    • SQL
    • None

    Description

      >>> sql("select * from range(8) t, lateral (select * from t) s")
      Traceback (most recent call last):
      ...
      pyspark.errors.exceptions.captured.AnalysisException: [TABLE_OR_VIEW_NOT_FOUND] The table or view `t` cannot be found. Verify the spelling and correctness of the schema and catalog.
      If you did not qualify the name with a schema, verify the current_schema() output, or qualify the name with the correct schema and catalog.
      To tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF EXISTS.; line 1 pos 49;
      'Project [*]
      +- 'LateralJoin lateral-subquery#0 [], Inner
         :  +- 'SubqueryAlias s
         :     +- 'Project [*]
         :        +- 'UnresolvedRelation [t], [], false
         +- SubqueryAlias t
            +- Range (0, 8, step=1, splits=None)

      The subquery (select * from t) seems not looking the outer outer context and fails to resolve t.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ueshin Takuya Ueshin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: