Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15926

DDL methos for tables should throw an exception when the tables exist or not

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      ANSI standard[1] requires two methods for either table manager functions (DDL):

      DROP TABLE [ IF EXISTS ] syntax
      CREATE TABLE [ IF NOT EXISTS ] syntax
      ALTER TABLE [ IF EXISTS ] syntax

      for implement all these functionalities I offer to handle exceptions (TableAlreadyExistsException, TableNotExistsException)

      TableManager#dropTable throws TableNotExistsException
      IgniteTables#createTable throws TableAlreadyExistsException
      IgniteTables#alterTable throws TableNotExistsException
      

      Also, the twins of these methods with `IfNotExists` suffix (and them asynchronous analogs) would be removed.

      [1] https://postgrespro.ru/docs/postgrespro/9.6/sql-altertable
       

      Attachments

        Issue Links

          Activity

            We don't need to provide separate method for every case. Mentioned functionality could be achieved by simply catching an exception and ignoring it, if needed.

            korlov Konstantin Orlov added a comment - We don't need to provide separate method for every case. Mentioned functionality could be achieved by simply catching an exception and ignoring it, if needed.

            I suppose it resolved erroneously, correct exception not thrown. Plz reopen it?
            I can call more that once tableManager.dropTable("TBL_NAME") and no exception thrown, also a can call it with not existing table, and no exception will be raised.

            zstan Evgeny Stanilovsky added a comment - I suppose it resolved erroneously, correct exception not thrown. Plz reopen it? I can call more that once tableManager.dropTable("TBL_NAME") and no exception thrown, also a can call it with not existing table, and no exception will be raised.

            v.pyatkov  LGTM

            alapin Alexander Lapin added a comment - v.pyatkov   LGTM

            People

              v.pyatkov Vladislav Pyatkov
              v.pyatkov Vladislav Pyatkov
              Alexander Lapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 6h 20m
                  6h 20m