cjj2010 opened a new issue, #31365:
URL: https://github.com/apache/doris/issues/31365

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   master
   
   ### What's Wrong?
   
   When add a new value column as bitmap on unique model schema occur error
   ```
   java.sql.SQLException: errCode = 2, detailMessage = complex type have to use 
aggregate function: device_id
           at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
           at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:371)
           at java_sql_PreparedStatement$execute.call(Unknown Source)
           at 
org.apache.doris.regression.util.JdbcUtils$_executeToList_closure1.doCall(JdbcUtils.groovy:31)
           at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
           at groovy.lang.Closure.call(Closure.java:412)
           at groovy.lang.Closure.call(Closure.java:428)
           at 
org.codehaus.groovy.runtime.IOGroovyMethods.withCloseable(IOGroovyMethods.java:1640)
           at org.codehaus.groovy.runtime.dgm$939.invoke(Unknown Source)
           at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
           at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
           at 
org.apache.doris.regression.util.JdbcUtils.executeToList(JdbcUtils.groovy:30)
           at 
org.apache.doris.regression.util.JdbcUtils$executeToList.call(Unknown Source)
           at org.apache.doris.regression.suite.Suite.sql_impl(Suite.groovy:274)
           at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
           at 
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
           at groovy.lang.MetaObjectProtocol$invokeMethod$0.call(Unknown Source)
           at 
org.apache.doris.regression.suite.Suite.invokeMethod(Suite.groovy:877)
           at 
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)
           at 
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:203)
           at org.apache.doris.regression.suite.Suite.jdbc_sql(Suite.groovy:282)
           at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
           at 
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
           at groovy.lang.MetaObjectProtocol$invokeMethod$0.call(Unknown Source)
           at 
org.apache.doris.regression.suite.Suite.invokeMethod(Suite.groovy:877)
           at 
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)
           at 
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
           at org.apache.doris.regression.suite.Suite.sql(Suite.groovy:293)
           at org.apache.doris.regression.suite.Suite.sql(Suite.groovy)
           at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:351)
           at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
           at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
           at 
test_unique_model_schema_value_change$_run_closure1.doCall(test_unique_model_schema_value_change.groovy:236)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
           at groovy.lang.Closure.call(Closure.java:412)
           at groovy.lang.Closure.call(Closure.java:428)
           at 
org.apache.doris.regression.suite.ScriptContext$_createAndRunSuite_closure1$_closure5.doCall(ScriptContext.groovy:108)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
           at groovy.lang.Closure.call(Closure.java:412)
           at 
org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:50)
           at 
org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:110)
           at com.sun.proxy.$Proxy9.apply(Unknown Source)
           at 
org.apache.doris.regression.suite.SuiteContext$_start_closure3.doCall(SuiteContext.groovy:436)
           at 
org.apache.doris.regression.suite.SuiteContext$_start_closure3.call(SuiteContext.groovy)
           at 
org.codehaus.groovy.runtime.IOGroovyMethods.withCloseable(IOGroovyMethods.java:1607)
           at 
org.apache.doris.regression.suite.SuiteContext.start(SuiteContext.groovy:433)
           at 
org.apache.doris.regression.suite.ScriptContext$_createAndRunSuite_closure1.doCall(ScriptContext.groovy:99)
           at 
org.apache.doris.regression.suite.ScriptContext$_createAndRunSuite_closure1.call(ScriptContext.groovy)
           at groovy.lang.Closure.run(Closure.java:493)
           at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   
   ```
   
   ### What You Expected?
   
   Return the correct prompt
   
   ### How to Reproduce?
   
   one step
   ```
   CREATE TABLE IF NOT EXISTS test_unique_model_schema_value_change 
                        (
                            `user_id` LARGEINT NOT NULL COMMENT "用户id",
                            `username` VARCHAR(50) NOT NULL COMMENT "用户昵称",
                             `city` VARCHAR(20) COMMENT "用户所在城市",
                             `age` SMALLINT COMMENT "用户年龄",
                             `sex` TINYINT COMMENT "用户性别",
                             `phone` LARGEINT COMMENT "用户电话",
                             `address` VARCHAR(500) COMMENT "用户地址",
                             `register_time` DATETIME COMMENT "用户注册时间"
                          )
                         UNIQUE KEY(`user_id`, `username`)
                         DISTRIBUTED BY HASH(`user_id`) BUCKETS 1
                         PROPERTIES (
                         "replication_allocation" = "tag.location.default: 1",
                         "enable_unique_key_merge_on_write" = "true"" 
                         );
   
   ```
   two step
   ```
   insert into test_unique_model_schema_value_change values(123456789, 'Alice', 
'Beijing', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00')
   ```
   
   three step
   ```
   alter  table ${tbName} add  column device_id   bitmap   AFTER username
   ````
   
   case 
   ```
   
regression-test/suites/schema_change_p0/test_unique_model_schema_value_change.groovy
   ```
   
![图片](https://github.com/apache/doris/assets/45192870/6528e0c2-f9d4-469b-84fa-411f0f816be1)
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to