[ 
https://issues.apache.org/jira/browse/IGNITE-21296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Gagarkin updated IGNITE-21296:
-----------------------------------
    Description: 
 
*Steps to Reproduce:*
 # Create a table using the command: {{{}CREATE TABLE TEST (id INT PRIMARY KEY, 
country VARCHAR){}}}.
 # Create a POJO with corresponding fields to the table.
 # Create a Key-Value (KV) view: {{{}KeyValueView<Integer, Country> 
countryValueView = table.keyValueView(Mapper.of(Integer.class), 
Mapper.of(Country.class));{}}}.
 # Insert some data into the table.
 # Alter the table by adding a new column: {{{}ALTER TABLE TEST ADD COLUMN city 
VARCHAR{}}}.
 # Create a new POJO to accommodate the added column.
 # Create a new KV view: {{{}KeyValueView<Integer, CountryCity> 
countryCityKeyValueView = 
CLUSTER.node(0).tables().table(TABLE_NAME).keyValueView(Mapper.of(Integer.class),
 Mapper.of(CountryCity.class));{}}}.
 # Attempt to remove data from the table using the first KV view: 
{{{}assertTrue(countryValueView.remove(null, 0, valuePojo));{}}}. This fails 
with the error "No mapped object field found for column 'CITY'".
 # Try to remove data using the second KV view: 
{{{}assertTrue(countryCityKeyValueView.remove(null, 0, new 
CountryCity(valuePojo.country(), null)));{}}}. This returns {{{}false{}}}.

*Expected Behavior:*

It should be possible to remove values using either of the KV views after 
altering the table structure.
*Actual Behavior:*
 * Unable to remove values using the first KV view due to the lack of a 'city' 
column in the original POJO.
 * Unable to remove values using the second KV view as the {{equals}} method 
does not function as expected.

  was:
 
*Steps to Reproduce:*
 # Create a table using the command: {{{}CREATE TABLE TEST (id INT PRIMARY KEY, 
country VARCHAR){}}}.
 # Create a POJO with corresponding fields to the table.
 # Create a Key-Value (KV) view: {{{}KeyValueView<Integer, Country> 
countryValueView = table.keyValueView(Mapper.of(Integer.class), 
Mapper.of(Country.class));{}}}.
 # Insert some data into the table.
 # Alter the table by adding a new column: {{{}ALTER TABLE TEST ADD COLUMN city 
VARCHAR{}}}.
 # Create a new POJO to accommodate the added column.
 # Create a new KV view: {{{}KeyValueView<Integer, CountryCity> 
countryCityKeyValueView = 
CLUSTER.node(0).tables().table(TABLE_NAME).keyValueView(Mapper.of(Integer.class),
 Mapper.of(CountryCity.class));{}}}.
 # Attempt to remove data from the table using the first KV view: 
{{{}assertTrue(countryValueView.remove(null, 0, valuePojo));{}}}. This fails 
with the error "No mapped object field found for column 'CITY'".
 # Try to remove data using the second KV view: 
{{{}assertTrue(countryCityKeyValueView.remove(null, 0, new 
CountryCity(valuePojo.country(), null)));{}}}. This returns {{{}false{}}}.


*Expected Behavior:*

 ** It should be possible to remove values using either of the KV views after 
altering the table structure.
*Actual Behavior:*

 ** Unable to remove values using the first KV view due to the lack of a 'city' 
column in the original POJO.
 ** Unable to remove values using the second KV view as the {{equals}} method 
does not function as expected.


> Altering the table causes the KV API to break
> ---------------------------------------------
>
>                 Key: IGNITE-21296
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21296
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Ivan Gagarkin
>            Priority: Critical
>              Labels: ignite-3
>         Attachments: alterTableTest1.java
>
>
>  
> *Steps to Reproduce:*
>  # Create a table using the command: {{{}CREATE TABLE TEST (id INT PRIMARY 
> KEY, country VARCHAR){}}}.
>  # Create a POJO with corresponding fields to the table.
>  # Create a Key-Value (KV) view: {{{}KeyValueView<Integer, Country> 
> countryValueView = table.keyValueView(Mapper.of(Integer.class), 
> Mapper.of(Country.class));{}}}.
>  # Insert some data into the table.
>  # Alter the table by adding a new column: {{{}ALTER TABLE TEST ADD COLUMN 
> city VARCHAR{}}}.
>  # Create a new POJO to accommodate the added column.
>  # Create a new KV view: {{{}KeyValueView<Integer, CountryCity> 
> countryCityKeyValueView = 
> CLUSTER.node(0).tables().table(TABLE_NAME).keyValueView(Mapper.of(Integer.class),
>  Mapper.of(CountryCity.class));{}}}.
>  # Attempt to remove data from the table using the first KV view: 
> {{{}assertTrue(countryValueView.remove(null, 0, valuePojo));{}}}. This fails 
> with the error "No mapped object field found for column 'CITY'".
>  # Try to remove data using the second KV view: 
> {{{}assertTrue(countryCityKeyValueView.remove(null, 0, new 
> CountryCity(valuePojo.country(), null)));{}}}. This returns {{{}false{}}}.
> *Expected Behavior:*
> It should be possible to remove values using either of the KV views after 
> altering the table structure.
> *Actual Behavior:*
>  * Unable to remove values using the first KV view due to the lack of a 
> 'city' column in the original POJO.
>  * Unable to remove values using the second KV view as the {{equals}} method 
> does not function as expected.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to