You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "kingbabingge (via GitHub)" <gi...@apache.org> on 2023/04/14 01:38:56 UTC

[GitHub] [doris] kingbabingge opened a new issue, #18660: Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES')

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

   ### 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
   
   v1.2.3
   
   ### What's Wrong?
   
   I use metbase connect doris(v1.2.3) but got error.
   
   
   ![image](https://user-images.githubusercontent.com/25143332/231919071-0dc4ee23-8815-4d8a-bb50-2f818df06ff7.png)
   
   
   # The doris log.
   ```shell
   2023-04-14 09:14:01,688 WARN (mysql-nio-pool-431|239644) [StmtExecutor.execute():589] execute Exception. stmt[71361, c3a9e3f7081c47ca-92ad719a70485c02]
   org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES')
   	at org.apache.doris.analysis.SetVar.analyze(SetVar.java:114) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.analysis.SetStmt.analyze(SetStmt.java:54) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:749) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:446) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:409) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:330) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:471) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:698) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_362]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_362]
   	at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_362]
   ```
   
   ### What You Expected?
   
   connect works.
   
   ### How to Reproduce?
   
   _No response_
   
   ### 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-unsubscribe@doris.apache.org.apache.org

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


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


[GitHub] [doris] kingbabingge commented on issue #18660: Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES')

Posted by "kingbabingge (via GitHub)" <gi...@apache.org>.
kingbabingge commented on issue #18660:
URL: https://github.com/apache/doris/issues/18660#issuecomment-1558522362

   ```java
   
   // metabase l链接doris 执行一个设置语句,
   set sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES');
   
   
   /** 
    * -FE 异常
   2023-05-22 08:37:40,443 WARN (mysql-nio-pool-1101|658532) [StmtExecutor.execute():589] execute Exception. stmt[93866, e2855042a75b4e68-a997203f6f74e72c]
   org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Set statement does't support computing expr:concat('STRICT_TRANS_TABLES', ',STRICT_TRANS_TABLES')
   	at org.apache.doris.analysis.SetVar.analyze(SetVar.java:114) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.analysis.SetStmt.analyze(SetStmt.java:54) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:749) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:446) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:409) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:330) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:471) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:698) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_362]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_362]
   	at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_362]
   
   
   
   
   
   // 抛出异常
   // org.apache.doris.analysis.Expr#getResultValue
   
       final Expr literalExpr = value.getResultValue(false);
           if (!(literalExpr instanceof LiteralExpr)) {
               throw new AnalysisException("Set statement does't support computing expr:" + literalExpr.toSql());
           }
   
   
    */
   
   使用arthas跟踪`org.apache.doris.analysis.ExpressionFunctions$FEFunctionSignature.getArgTypes`
   
   ```shell
   Affect(class count: 1 , method count: 1) cost in 212 ms, listenerId: 30
   method=org.apache.doris.analysis.ExpressionFunctions$FEFunctionSignature.getArgTypes location=AtEnter
   ts=2023-05-19 13:05:27; [cost=0.04367ms] result=@ArrayList[
       @Object[][isEmpty=true;size=0],
       @FEFunctionSignature[
           name=@String[concat],
           argTypes=@Type[][isEmpty=false;size=1],
           returnType=@ScalarType[VARCHAR(*)],
       ],
       null,
   ]
   method=org.apache.doris.analysis.ExpressionFunctions$FEFunctionSignature.getArgTypes location=AtExit
   ts=2023-05-19 13:05:27; [cost=1.0897417243898684E10ms] result=@ArrayList[
       @Object[][isEmpty=true;size=0],
       @FEFunctionSignature[
           name=@String[concat],
           argTypes=@Type[][isEmpty=false;size=1],
           returnType=@ScalarType[VARCHAR(*)],
       ],
       @Type[][
           @ScalarType[VARCHAR(100)],
      
   ```
   
   发现 ScalarType 中 len 变成 100,导致  DEFAULT_VARCHAR=@ScalarType[VARCHAR(100)],
   `org.apache.doris.analysis.ExpressionFunctions$FEFunctionSignature.getArgTypes `
   ```shell
   method=org.apache.doris.analysis.ExpressionFunctions$FEFunctionSignature.getArgTypes location=AtExit
   ts=2023-05-19 13:09:36; [cost=1.0897666158566805E10ms] result=@ArrayList[
       @Object[][isEmpty=true;size=0],
       @FEFunctionSignature[
           name=@String[concat],
           argTypes=@Type[][
               @ScalarType[VARCHAR(100)],
           ],
           returnType=@ScalarType[
               DATETIME_PRECISION=@Integer[18],
               DEFAULT_PRECISION=@Integer[9],
               DEFAULT_SCALE=@Integer[0],
               MAX_VARCHAR_LENGTH=@Integer[65533],
               MAX_CHAR_LENGTH=@Integer[255],
               MAX_HLL_LENGTH=@Integer[16385],
               CHAR_INLINE_LENGTH=@Integer[128],
               MAX_STRING_LENGTH=@Integer[2147483643],
               MAX_JSONB_LENGTH=@Integer[2147483643],
               MAX_PRECISION=@Integer[38],
               MAX_DECIMALV2_PRECISION=@Integer[27],
               MAX_DECIMALV2_SCALE=@Integer[9],
               MAX_DECIMAL32_PRECISION=@Integer[9],
               MAX_DECIMAL64_PRECISION=@Integer[18],
               MAX_DECIMAL128_PRECISION=@Integer[38],
               DEFAULT_MIN_AVG_DECIMAL128_SCALE=@Integer[4],
               MAX_DATETIMEV2_SCALE=@Integer[6],
               LOG=@Logger[org.apache.doris.catalog.ScalarType:INFO in 7852e922],
               type=@PrimitiveType[VARCHAR],
               len=@Integer[-1],
               precision=@Integer[0],
               scale=@Integer[0],
               precisionStr=null,
               scaleStr=null,
               lenStr=null,
               MAX_NESTING_DEPTH=@Integer[9],
               INVALID=@ScalarType[INVALID_TYPE],
               UNSUPPORTED=@ScalarType[UNSUPPORTED_TYPE],
               NULL=@ScalarType[NULL_TYPE],
               BOOLEAN=@ScalarType[BOOLEAN],
               TINYINT=@ScalarType[TINYINT],
               SMALLINT=@ScalarType[SMALLINT],
               INT=@ScalarType[INT],
               BIGINT=@ScalarType[BIGINT],
               LARGEINT=@ScalarType[LARGEINT],
               FLOAT=@ScalarType[FLOAT],
               DOUBLE=@ScalarType[DOUBLE],
               DATE=@ScalarType[DATE],
               DATETIME=@ScalarType[DATETIME],
               DATEV2=@ScalarType[DATEV2],
               TIMEV2=@ScalarType[TIMEV2(0)],
               TIME=@ScalarType[TIME],
               STRING=@ScalarType[TEXT],
               DEFAULT_DECIMALV2=@ScalarType[DECIMAL(9,0)],
               MAX_DECIMALV2_TYPE=@ScalarType[DECIMAL(27,9)],
               DEFAULT_DECIMAL32=@ScalarType[DECIMALV3(9,0)],
               DEFAULT_DECIMAL64=@ScalarType[DECIMALV3(18,0)],
               DEFAULT_DECIMAL128=@ScalarType[DECIMALV3(38,0)],
               DEFAULT_DECIMALV3=@ScalarType[DECIMALV3(9,0)],
               DEFAULT_DATETIMEV2=@ScalarType[DATETIMEV2(0)],
               DATETIMEV2=@ScalarType[DATETIMEV2(0)],
               DEFAULT_TIMEV2=@ScalarType[TIMEV2(0)],
               DECIMALV2=@ScalarType[DECIMAL(9,0)],
               DECIMAL32=@ScalarType[DECIMALV3(9,0)],
               DECIMAL64=@ScalarType[DECIMALV3(18,0)],
               DECIMAL128=@ScalarType[DECIMALV3(38,0)],
               JSONB=@ScalarType[JSONB],
               DEFAULT_VARCHAR=@ScalarType[VARCHAR(100)],
               VARCHAR=@ScalarType[VARCHAR(*)],
               HLL=@ScalarType[HLL],
               CHAR=@ScalarType[CHAR(*)],
               BITMAP=@ScalarType[BITMAP],
               QUANTILE_STATE=@ScalarType[QUANTILE_STATE],
               ALL=@ScalarType[ALL],
               MAP=@MapType[org.apache.doris.catalog.MapType@688b5942],
               ARRAY=@ArrayType[ARRAY<NULL_TYPE>],
               STRUCT=@StructType[STRUCT<>],
               LOG=@Logger[org.apache.doris.catalog.Type:INFO in 7852e922],
               integerTypes=@ArrayList[isEmpty=false;size=5],
               numericTypes=@ArrayList[isEmpty=false;size=11],
               supportedTypes=@ArrayList[isEmpty=false;size=29],
               arraySubTypes=@ArrayList[isEmpty=false;size=16],
               trivialTypes=@ArrayList[isEmpty=false;size=25],
               DATE_SUPPORTED_JAVA_TYPE=@HashSet[isEmpty=false;size=3],
               DATETIME_SUPPORTED_JAVA_TYPE=@HashSet[isEmpty=false;size=3],
               PrimitiveTypeToJavaClassType=@RegularImmutableMap[isEmpty=false;size=19],
               OnlyMetricTypeErrorMsg=@String[Doris hll, bitmap and array column must use with specific function, and don't support filter or group by.please run 'help hll' or 'help bitmap' or 'help array' in your mysql client.],
               compatibilityMatrix=@PrimitiveType[][][isEmpty=false;size=33],
               strictCompatibilityMatrix=@PrimitiveType[][][isEmpty=false;size=33],
           ],
       ],
   ```
   
   
   
   
   
   
   
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [I] Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES') [doris]

Posted by "CookingBoy (via GitHub)" <gi...@apache.org>.
CookingBoy commented on issue #18660:
URL: https://github.com/apache/doris/issues/18660#issuecomment-1825304268

   > concat 函数在启动FE时注册。VARCHAR 类型len =-1 ,什么情况下会导致修改 len的值?
   > 
   > ```java
   >     private void registerFEFunction(ImmutableMultimap.Builder<String, FEFunctionInvoker> mapBuilder,
   >                                     Method method, FEFunction annotation) {
   >         if (annotation != null) {
   >             String name = annotation.name();
   >             System.out.println(PrimitiveType.valueOf(annotation.returnType()));
   >             Type returnType = Type.fromPrimitiveType(PrimitiveType.valueOf(annotation.returnType()));
   >             List<Type> argTypes = new ArrayList<>();
   >             for (String type : annotation.argTypes()) {
   >                 argTypes.add(ScalarType.createType(type));
   >             }
   >             FEFunctionSignature signature = new FEFunctionSignature(name,
   >                     argTypes.toArray(new Type[argTypes.size()]), returnType);
   >             mapBuilder.put(name, new FEFunctionInvoker(method, signature));
   >         }
   >     }
   > ```
   > 
   > 猜测,metabase连接doris后一些初始化脚本,导致doris 的concat 函数的 FEFunctionInvoker中 VARCHAR参数变成了 100.
   > 
   > 什么情况下才会修改这个信息呢?
   
   请问您解决这个问题了么


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] kingbabingge commented on issue #18660: Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES')

Posted by "kingbabingge (via GitHub)" <gi...@apache.org>.
kingbabingge commented on issue #18660:
URL: https://github.com/apache/doris/issues/18660#issuecomment-1558524327

   
   concat 函数在启动FE时注册。VARCHAR 类型len =-1 ,什么会情况下会导致修改 len的值?
   
   
   ```java
       private void registerFEFunction(ImmutableMultimap.Builder<String, FEFunctionInvoker> mapBuilder,
                                       Method method, FEFunction annotation) {
           if (annotation != null) {
               String name = annotation.name();
               System.out.println(PrimitiveType.valueOf(annotation.returnType()));
               Type returnType = Type.fromPrimitiveType(PrimitiveType.valueOf(annotation.returnType()));
               List<Type> argTypes = new ArrayList<>();
               for (String type : annotation.argTypes()) {
                   argTypes.add(ScalarType.createType(type));
               }
               FEFunctionSignature signature = new FEFunctionSignature(name,
                       argTypes.toArray(new Type[argTypes.size()]), returnType);
               mapBuilder.put(name, new FEFunctionInvoker(method, signature));
           }
       }
   ```


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [I] Set statement does't support computing expr:concat('', ',STRICT_TRANS_TABLES') [doris]

Posted by "zengchen00 (via GitHub)" <gi...@apache.org>.
zengchen00 commented on issue #18660:
URL: https://github.com/apache/doris/issues/18660#issuecomment-1880302232

   我也碰到了,重启 fe,重新注册 concat 函数


-- 
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-unsubscribe@doris.apache.org

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


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