You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (Jira)" <ji...@apache.org> on 2020/05/20 14:48:00 UTC

[jira] [Created] (FLINK-17845) Can't remove a table connector property with ALTER TABLE

Fabian Hueske created FLINK-17845:
-------------------------------------

             Summary: Can't remove a table connector property with ALTER TABLE
                 Key: FLINK-17845
                 URL: https://issues.apache.org/jira/browse/FLINK-17845
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API
            Reporter: Fabian Hueske


It is not possible to remove an existing table property from a table.
Looking at the [source code|https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java#L295] this seems to be the intended semantics, but it seems counter-intuitive to me.

If I create a table with the following statement:

{code}
CREATE TABLE `testTable` (
  id INT
)
WITH (
    'connector.type' = 'kafka',
    'connector.version' = 'universal',
    'connector.topicX' = 'test',      -- Woops, I made a typo here
    [...]
)
{code}
The statement will be successfully executed. However, the table cannot be used due to the typo.

Fixing the typo with the following DDL is not possible:

{code}
ALTER TABLE `testTable` SET (
    'connector.type' = 'kafka',
    'connector.version' = 'universal',
    'connector.topic' = 'test',      -- Fixing the typo
)
{code}

because the key {{connector.topicX}} is not removed.

Right now it seems that the only way to fix a table with an invalid key is to DROP and CREATE it. I think that this use case should be supported by ALTER TABLE.
I would even argue that the expected behavior is that previous properties are removed and replaced by the new properties.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)