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

Spark SQL does not support creating views using DataSource v2 based data sources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.8, 3.1.2
    • 3.3.0
    • SQL
    • None

    Description

      When a temporary view is created in Spark SQL using an external data source, Spark then tries to create the relevant relation using DataSource.resolveRelation() method. Unlike DataFrameReader.load(), resolveRelation() does not check if the provided DataSource implements the DataSourceV2 interface and instead tries to use the RelationProvider trait in order to generate the Relation.

      Furthermore, DataSourceV2Relation is not a subclass of BaseRelation, so it cannot be used in resolveRelation().

      Last, I tried to implement the RelationProvider trait in my Java implementation of DataSourceV2, but the match inside resolveRelation() did not detect it as RelationProvider.

       

      Attachments

        Issue Links

          Activity

            People

              planga82 Pablo Langa Blanco
              davidrabinowitz David Rabinowitz
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: