Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The new fields are not compatible with the data of the old version #2097

Closed
2 tasks done
Tracked by #1847
zhongqishang opened this issue Oct 13, 2023 · 0 comments · Fixed by #2098
Closed
2 tasks done
Tracked by #1847

[Bug]: The new fields are not compatible with the data of the old version #2097

zhongqishang opened this issue Oct 13, 2023 · 0 comments · Fixed by #2098
Labels
type:bug Something isn't working

Comments

@zhongqishang
Copy link
Contributor

zhongqishang commented Oct 13, 2023

What happened?

AMS startup error.

Affects Versions

master

What engines are you seeing the problem on?

AMS

How to reproduce

  1. The database has tables in iceberg format
  2. Execute update.sql to add the format field
  3. Start AMS

Relevant log output

2023-10-13 15:02:00,960 ERROR [main] [com.netease.arctic.server.ArcticServiceContainer] [] - AMS start error
com.netease.arctic.server.exception.PersistenceException: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'format' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
### The error may exist in com/netease/arctic/server/persistence/mapper/TableMetaMapper.java (best guess)
### The error may involve com.netease.arctic.server.persistence.mapper.TableMetaMapper.selectTableRuntimeMetas
### The error occurred while handling results
### SQL: SELECT a.table_id, a.catalog_name, a.db_name, a.table_name, a.format, a.current_snapshot_id, a.current_change_snapshotId, a.last_optimized_snapshotId, a.last_optimized_change_snapshotId, a.last_major_optimizing_time, a.last_minor_optimizing_time, a.last_full_optimizing_time, a.optimizing_status, a.optimizing_status_start_time, a.optimizing_process_id, a.optimizer_group, a.table_config, a.pending_input, b.optimizing_type, b.target_snapshot_id, b.target_change_snapshot_id, b.plan_time, b.from_sequence, b.to_sequence FROM table_runtime a LEFT JOIN table_optimizing_process b ON a.optimizing_process_id = b.process_id
### Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'format' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
	at com.netease.arctic.server.exception.ArcticRuntimeException.wrap(ArcticRuntimeException.java:123) ~[classes/:?]
	at com.netease.arctic.server.persistence.PersistentBase.getAs(PersistentBase.java:78) ~[classes/:?]
	at com.netease.arctic.server.table.DefaultTableService.initialize(DefaultTableService.java:304) ~[classes/:?]
	at com.netease.arctic.server.ArcticServiceContainer.startService(ArcticServiceContainer.java:144) ~[classes/:?]
	at com.netease.arctic.server.ArcticServiceContainer.main(ArcticServiceContainer.java:107) [classes/:?]
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'format' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
### The error may exist in com/netease/arctic/server/persistence/mapper/TableMetaMapper.java (best guess)
### The error may involve com.netease.arctic.server.persistence.mapper.TableMetaMapper.selectTableRuntimeMetas
### The error occurred while handling results
### SQL: SELECT a.table_id, a.catalog_name, a.db_name, a.table_name, a.format, a.current_snapshot_id, a.current_change_snapshotId, a.last_optimized_snapshotId, a.last_optimized_change_snapshotId, a.last_major_optimizing_time, a.last_minor_optimizing_time, a.last_full_optimizing_time, a.optimizing_status, a.optimizing_status_start_time, a.optimizing_process_id, a.optimizer_group, a.table_config, a.pending_input, b.optimizing_type, b.target_snapshot_id, b.target_change_snapshot_id, b.plan_time, b.from_sequence, b.to_sequence FROM table_runtime a LEFT JOIN table_optimizing_process b ON a.optimizing_process_id = b.process_id
### Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'format' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.6.jar:3.5.6]
	at com.sun.proxy.$Proxy39.selectTableRuntimeMetas(Unknown Source) ~[?:?]
	at com.netease.arctic.server.persistence.PersistentBase.getAs(PersistentBase.java:75) ~[classes/:?]
	... 3 more
Caused by: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'format' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
	at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:87) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:511) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:480) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:404) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:354) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:328) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:301) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:194) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.6.jar:3.5.6]
	at com.sun.proxy.$Proxy39.selectTableRuntimeMetas(Unknown Source) ~[?:?]
	at com.netease.arctic.server.persistence.PersistentBase.getAs(PersistentBase.java:75) ~[classes/:?]
	... 3 more
Caused by: java.lang.IllegalArgumentException: No enum constant com.netease.arctic.ams.api.TableFormat.
	at java.lang.Enum.valueOf(Enum.java:238) ~[?:1.8.0_331]
	at org.apache.ibatis.type.EnumTypeHandler.getNullableResult(EnumTypeHandler.java:49) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.type.EnumTypeHandler.getNullableResult(EnumTypeHandler.java:26) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:85) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:511) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:480) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:404) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:354) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:328) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:301) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:194) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.6.jar:3.5.6]
	at com.sun.proxy.$Proxy39.selectTableRuntimeMetas(Unknown Source) ~[?:?]
	at com.netease.arctic.server.persistence.PersistentBase.getAs(PersistentBase.java:75) ~[classes/:?]
	... 3 more

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant