Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33392 Align DSv2 commands to DSv1 implementation
  3. SPARK-33965

CACHE TABLE does not support `spark_catalog` in Hive table names

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • SQL
    • None

    Description

      The test fails:

        test("SPARK-XXXXX: cache table in spark_catalog") {
          withNamespace("spark_catalog.ns") {
            sql("CREATE NAMESPACE spark_catalog.ns")
            val t = "spark_catalog.ns.tbl"
            withTable(t) {
              sql(s"CREATE TABLE $t (col int)")
              assert(!spark.catalog.isCached(t))
              sql(s"CACHE TABLE $t")
              assert(spark.catalog.isCached(t))
            }
          }
        }
      

      with the exception:

      [info] - SPARK-XXXXX: cache table in spark_catalog *** FAILED *** (278 milliseconds)
      [info]   org.apache.spark.sql.AnalysisException: spark_catalog.ns.tbl is not a valid TableIdentifier as it has more than 2 name parts.
      [info]   at org.apache.spark.sql.connector.catalog.CatalogV2Implicits$MultipartIdentifierHelper.asTableIdentifier(CatalogV2Implicits.scala:130)
      [info]   at org.apache.spark.sql.hive.test.TestHiveQueryExecution.$anonfun$analyzed$1(TestHive.scala:600)
      

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: