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

DS V2 Index Support

    XMLWordPrintableJSON

Details

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

    Description

      Many data sources support index to improvement query performance. In order to take advantage of the index support in data source, the following APIs will be added for working with indexes:

       public interface SupportsIndex extends Table {
      
        /**
         * Creates an index.
         *
         * @param indexName the name of the index to be created
         * @param indexType the type of the index to be created. If this is not specified, Spark
         *                  will use empty String.
         * @param columns the columns on which index to be created
         * @param columnsProperties the properties of the columns on which index to be created
         * @param properties the properties of the index to be created
         * @throws IndexAlreadyExistsException If the index already exists.
         */
        void createIndex(String indexName,
            String indexType,
            NamedReference[] columns,
            Map<NamedReference, Map<String, String>> columnsProperties,
            Map<String, String> properties)
            throws IndexAlreadyExistsException;
      
        /**
         * Drops the index with the given name.
         *
         * @param indexName the name of the index to be dropped.
         * @throws NoSuchIndexException If the index does not exist.
         */
        void dropIndex(String indexName) throws NoSuchIndexException;
      
        /**
         * Checks whether an index exists in this table.
         *
         * @param indexName the name of the index
         * @return true if the index exists, false otherwise
         */
        boolean indexExists(String indexName);
      
        /**
         * Lists all the indexes in this table.
         */
        TableIndex[] listIndexes();
      }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            huaxingao Huaxin Gao
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: