Class SparkCachedTableCatalog

  • All Implemented Interfaces:
    org.apache.spark.sql.connector.catalog.CatalogPlugin, org.apache.spark.sql.connector.catalog.FunctionCatalog, org.apache.spark.sql.connector.catalog.TableCatalog

    public class SparkCachedTableCatalog
    extends java.lang.Object
    implements org.apache.spark.sql.connector.catalog.TableCatalog
    An internal table catalog that is capable of loading tables from a cache.
    • Field Summary

      • Fields inherited from interface org.apache.spark.sql.connector.catalog.TableCatalog

        OPTION_PREFIX, PROP_COMMENT, PROP_EXTERNAL, PROP_IS_MANAGED_LOCATION, PROP_LOCATION, PROP_OWNER, PROP_PROVIDER
    • Method Summary

      All Methods Instance Methods Concrete Methods Default Methods 
      Modifier and Type Method Description
      SparkTable alterTable​(org.apache.spark.sql.connector.catalog.Identifier ident, org.apache.spark.sql.connector.catalog.TableChange... changes)  
      SparkTable createTable​(org.apache.spark.sql.connector.catalog.Identifier ident, org.apache.spark.sql.types.StructType schema, org.apache.spark.sql.connector.expressions.Transform[] partitions, java.util.Map<java.lang.String,​java.lang.String> properties)  
      boolean dropTable​(org.apache.spark.sql.connector.catalog.Identifier ident)  
      void initialize​(java.lang.String catalogName, org.apache.spark.sql.util.CaseInsensitiveStringMap options)  
      void invalidateTable​(org.apache.spark.sql.connector.catalog.Identifier ident)  
      default boolean isExistingNamespace​(java.lang.String[] namespace)  
      default boolean isFunctionNamespace​(java.lang.String[] namespace)  
      default org.apache.spark.sql.connector.catalog.Identifier[] listFunctions​(java.lang.String[] namespace)  
      org.apache.spark.sql.connector.catalog.Identifier[] listTables​(java.lang.String[] namespace)  
      default org.apache.spark.sql.connector.catalog.functions.UnboundFunction loadFunction​(org.apache.spark.sql.connector.catalog.Identifier ident)  
      SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident)  
      SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident, long timestampMicros)  
      SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident, java.lang.String version)  
      java.lang.String name()  
      boolean purgeTable​(org.apache.spark.sql.connector.catalog.Identifier ident)  
      void renameTable​(org.apache.spark.sql.connector.catalog.Identifier oldIdent, org.apache.spark.sql.connector.catalog.Identifier newIdent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.spark.sql.connector.catalog.CatalogPlugin

        defaultNamespace
      • Methods inherited from interface org.apache.spark.sql.connector.catalog.FunctionCatalog

        functionExists
      • Methods inherited from interface org.apache.spark.sql.connector.catalog.TableCatalog

        capabilities, createTable, tableExists, useNullableQuerySchema
    • Constructor Detail

      • SparkCachedTableCatalog

        public SparkCachedTableCatalog()
    • Method Detail

      • listTables

        public org.apache.spark.sql.connector.catalog.Identifier[] listTables​(java.lang.String[] namespace)
        Specified by:
        listTables in interface org.apache.spark.sql.connector.catalog.TableCatalog
      • loadTable

        public SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident)
                             throws org.apache.spark.sql.catalyst.analysis.NoSuchTableException
        Specified by:
        loadTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.NoSuchTableException
      • loadTable

        public SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident,
                                    java.lang.String version)
                             throws org.apache.spark.sql.catalyst.analysis.NoSuchTableException
        Specified by:
        loadTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.NoSuchTableException
      • loadTable

        public SparkTable loadTable​(org.apache.spark.sql.connector.catalog.Identifier ident,
                                    long timestampMicros)
                             throws org.apache.spark.sql.catalyst.analysis.NoSuchTableException
        Specified by:
        loadTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.NoSuchTableException
      • invalidateTable

        public void invalidateTable​(org.apache.spark.sql.connector.catalog.Identifier ident)
        Specified by:
        invalidateTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
      • createTable

        public SparkTable createTable​(org.apache.spark.sql.connector.catalog.Identifier ident,
                                      org.apache.spark.sql.types.StructType schema,
                                      org.apache.spark.sql.connector.expressions.Transform[] partitions,
                                      java.util.Map<java.lang.String,​java.lang.String> properties)
                               throws org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException
        Specified by:
        createTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException
      • alterTable

        public SparkTable alterTable​(org.apache.spark.sql.connector.catalog.Identifier ident,
                                     org.apache.spark.sql.connector.catalog.TableChange... changes)
        Specified by:
        alterTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
      • dropTable

        public boolean dropTable​(org.apache.spark.sql.connector.catalog.Identifier ident)
        Specified by:
        dropTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
      • purgeTable

        public boolean purgeTable​(org.apache.spark.sql.connector.catalog.Identifier ident)
                           throws java.lang.UnsupportedOperationException
        Specified by:
        purgeTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
        Throws:
        java.lang.UnsupportedOperationException
      • renameTable

        public void renameTable​(org.apache.spark.sql.connector.catalog.Identifier oldIdent,
                                org.apache.spark.sql.connector.catalog.Identifier newIdent)
        Specified by:
        renameTable in interface org.apache.spark.sql.connector.catalog.TableCatalog
      • initialize

        public void initialize​(java.lang.String catalogName,
                               org.apache.spark.sql.util.CaseInsensitiveStringMap options)
        Specified by:
        initialize in interface org.apache.spark.sql.connector.catalog.CatalogPlugin
      • name

        public java.lang.String name()
        Specified by:
        name in interface org.apache.spark.sql.connector.catalog.CatalogPlugin
      • isFunctionNamespace

        public default boolean isFunctionNamespace​(java.lang.String[] namespace)
      • isExistingNamespace

        public default boolean isExistingNamespace​(java.lang.String[] namespace)
      • listFunctions

        public default org.apache.spark.sql.connector.catalog.Identifier[] listFunctions​(java.lang.String[] namespace)
                                                                                  throws org.apache.spark.sql.catalyst.analysis.NoSuchNamespaceException
        Specified by:
        listFunctions in interface org.apache.spark.sql.connector.catalog.FunctionCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.NoSuchNamespaceException
      • loadFunction

        public default org.apache.spark.sql.connector.catalog.functions.UnboundFunction loadFunction​(org.apache.spark.sql.connector.catalog.Identifier ident)
                                                                                              throws org.apache.spark.sql.catalyst.analysis.NoSuchFunctionException
        Specified by:
        loadFunction in interface org.apache.spark.sql.connector.catalog.FunctionCatalog
        Throws:
        org.apache.spark.sql.catalyst.analysis.NoSuchFunctionException