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

Maksim Zhuravkov updated IGNITE-22929:
--------------------------------------
    Ignite Flags:   (was: Docs Required,Release Notes Required)

> Sql. REGEX_REPLACE. Unable to compile expression
> ------------------------------------------------
>
>                 Key: IGNITE-22929
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22929
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>
> {noformat}
> SELECT regexp_replace('ANA', 'ana', 'banana', 'i')
> {noformat}
> Expected:  banana
> But got an error:
> {noformat}
> Caused by: org.apache.ignite.sql.SqlException: IGN-CMN-65535 
> TraceId:c9b560ec-bcff-4afb-94d9-bcb8c03eaa52 Unable to compile expression
>       at 
> java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils$1.copy(ExceptionUtils.java:789)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils$ExceptionFactory.createCopy(ExceptionUtils.java:723)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.copyExceptionWithCause(ExceptionUtils.java:525)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.copyExceptionWithCauseInternal(ExceptionUtils.java:658)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.copyExceptionWithCause(ExceptionUtils.java:476)
>       at 
> org.apache.ignite.internal.sql.api.IgniteSqlImpl.execute(IgniteSqlImpl.java:210)
>       at 
> org.apache.ignite.internal.sql.api.PublicApiThreadingIgniteSql.lambda$execute$1(PublicApiThreadingIgniteSql.java:65)
>       at 
> org.apache.ignite.internal.thread.PublicApiThreading.executeWithRole(PublicApiThreading.java:144)
>       at 
> org.apache.ignite.internal.thread.PublicApiThreading.execUserSyncOperation(PublicApiThreading.java:102)
>       at 
> org.apache.ignite.internal.sql.api.PublicApiThreadingIgniteSql.execute(PublicApiThreadingIgniteSql.java:65)
>       at 
> org.apache.ignite.internal.sql.sqllogic.ScriptContext.executeQuery(ScriptContext.java:85)
>       at org.apache.ignite.internal.sql.sqllogic.Query.execute(Query.java:263)
>       at 
> org.apache.ignite.internal.sql.sqllogic.SqlScriptRunner.run(SqlScriptRunner.java:70)
>       ... 4 more
> Caused by: java.util.concurrent.CompletionException: 
> org.apache.ignite.sql.SqlException: IGN-CMN-65535 
> TraceId:c9b560ec-bcff-4afb-94d9-bcb8c03eaa52 Unable to compile expression
>       at 
> org.apache.ignite.internal.sql.api.IgniteSqlImpl.lambda$executeAsyncInternal$5(IgniteSqlImpl.java:379)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
>       at 
> org.apache.ignite.internal.sql.engine.exec.TxAwareAsyncCursor.lambda$closeAsync$4(TxAwareAsyncCursor.java:84)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$close$23(ExecutionServiceImpl.java:1261)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
>       at 
> org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:83)
>       ... 3 more
> Caused by: org.apache.ignite.sql.SqlException: IGN-CMN-65535 
> TraceId:c9b560ec-bcff-4afb-94d9-bcb8c03eaa52 Unable to compile expression
>       at 
> org.apache.ignite.internal.lang.SqlExceptionMapperUtil.mapToPublicSqlException(SqlExceptionMapperUtil.java:61)
>       at 
> org.apache.ignite.internal.sql.engine.exec.TxAwareAsyncCursor.wrapIfNecessary(TxAwareAsyncCursor.java:131)
>       at 
> org.apache.ignite.internal.sql.engine.exec.TxAwareAsyncCursor.handleError(TxAwareAsyncCursor.java:108)
>       at 
> org.apache.ignite.internal.sql.engine.exec.TxAwareAsyncCursor.lambda$requestNextAsync$2(TxAwareAsyncCursor.java:60)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.acknowledgeFragment(ExecutionServiceImpl.java:852)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.onMessage(ExecutionServiceImpl.java:532)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl.lambda$start$2(ExecutionServiceImpl.java:278)
>       at 
> org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.onMessageInternal(MessageServiceImpl.java:151)
>       at 
> org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.lambda$onMessage$1(MessageServiceImpl.java:117)
>       ... 4 more
> Caused by: org.apache.ignite.lang.IgniteException: IGN-CMN-65535 
> TraceId:c9b560ec-bcff-4afb-94d9-bcb8c03eaa52 Unable to compile expression
>       at 
> org.apache.ignite.internal.lang.IgniteExceptionMapperUtil.lambda$mapToPublicException$2(IgniteExceptionMapperUtil.java:88)
>       at 
> org.apache.ignite.internal.lang.IgniteExceptionMapperUtil.mapCheckingResultIsPublic(IgniteExceptionMapperUtil.java:141)
>       at 
> org.apache.ignite.internal.lang.IgniteExceptionMapperUtil.mapToPublicException(IgniteExceptionMapperUtil.java:137)
>       at 
> org.apache.ignite.internal.lang.IgniteExceptionMapperUtil.mapToPublicException(IgniteExceptionMapperUtil.java:88)
>       at 
> org.apache.ignite.internal.lang.SqlExceptionMapperUtil.mapToPublicSqlException(SqlExceptionMapperUtil.java:51)
>       ... 16 more
> Caused by: org.apache.ignite.internal.lang.IgniteInternalException: 
> IGN-CMN-65535 TraceId:c9b560ec-bcff-4afb-94d9-bcb8c03eaa52 Unable to compile 
> expression
>       at 
> org.apache.ignite.internal.sql.engine.util.Commons.compile(Commons.java:369)
>       at 
> org.apache.ignite.internal.sql.engine.exec.exp.ExpressionFactoryImpl.compile(ExpressionFactoryImpl.java:643)
>       at 
> org.apache.ignite.internal.sql.engine.exec.exp.ExpressionFactoryImpl.lambda$scalar$3(ExpressionFactoryImpl.java:557)
>       at 
> com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$13(BoundedLocalCache.java:2457)
>       at 
> java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
>       at 
> com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2455)
>       at 
> com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2438)
>       at 
> com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:107)
>       at 
> org.apache.ignite.internal.sql.engine.exec.exp.ExpressionFactoryImpl.scalar(ExpressionFactoryImpl.java:556)
>       at 
> org.apache.ignite.internal.sql.engine.exec.exp.ExpressionFactoryImpl.project(ExpressionFactoryImpl.java:274)
>       at 
> org.apache.ignite.internal.sql.engine.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:243)
>       at 
> org.apache.ignite.internal.sql.engine.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:136)
>       at 
> org.apache.ignite.internal.sql.engine.rel.IgniteProject.accept(IgniteProject.java:95)
>       at 
> org.apache.ignite.internal.sql.engine.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:908)
>       at 
> org.apache.ignite.internal.sql.engine.exec.LogicalRelImplementor.go(LogicalRelImplementor.java:935)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.executeFragment(ExecutionServiceImpl.java:882)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$submitFragment$10(ExecutionServiceImpl.java:950)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
>       at 
> java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionContext.lambda$execute$0(ExecutionContext.java:332)
>       ... 4 more
> Caused by: org.codehaus.commons.compiler.CompileException: Line 3, Column 78: 
> No applicable constructor/method found for actual parameters 
> "java.lang.String, java.lang.String, java.lang.String, long"; candidates are: 
> "public java.lang.String 
> org.apache.calcite.runtime.SqlFunctions$RegexFunction.regexpReplace(java.lang.String,
>  java.lang.String, java.lang.String)", "public java.lang.String 
> org.apache.calcite.runtime.SqlFunctions$RegexFunction.regexpReplace(java.lang.String,
>  java.lang.String, java.lang.String, int, int)", "public java.lang.String 
> org.apache.calcite.runtime.SqlFunctions$RegexFunction.regexpReplace(java.lang.String,
>  java.lang.String, java.lang.String, int, int, java.lang.String)", "public 
> java.lang.String 
> org.apache.calcite.runtime.SqlFunctions$RegexFunction.regexpReplace(java.lang.String,
>  java.lang.String, java.lang.String, int)"
>       at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:13228)
>       at 
> org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:9794)
>       at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9654)
>       at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9570)
>       at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:7663)
>       at org.codehaus.janino.UnitCompiler.access$16200(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$25.visitMethodInvocation(UnitCompiler.java:6923)
>       at 
> org.codehaus.janino.UnitCompiler$25.visitMethodInvocation(UnitCompiler.java:6909)
>       at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
>       at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6909)
>       at 
> org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:9769)
>       at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9654)
>       at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9570)
>       at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5322)
>       at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4824)
>       at 
> org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4800)
>       at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
>       at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4800)
>       at 
> org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5945)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:4177)
>       at org.codehaus.janino.UnitCompiler.access$6100(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:4151)
>       at 
> org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:4126)
>       at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:4126)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2572)
>       at org.codehaus.janino.UnitCompiler.access$1800(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1584)
>       at 
> org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1579)
>       at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:3209)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1579)
>       at 
> org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1665)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1650)
>       at org.codehaus.janino.UnitCompiler.access$1700(UnitCompiler.java:240)
>       at org.codehaus.janino.UnitCompiler$6.visitBlock(UnitCompiler.java:1583)
>       at org.codehaus.janino.UnitCompiler$6.visitBlock(UnitCompiler.java:1579)
>       at org.codehaus.janino.Java$Block.accept(Java.java:3115)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1579)
>       at org.codehaus.janino.UnitCompiler.access$4000(UnitCompiler.java:240)
>       at org.codehaus.janino.UnitCompiler$8.compile(UnitCompiler.java:3004)
>       at 
> org.codehaus.janino.UnitCompiler.compileTryCatch(UnitCompiler.java:3302)
>       at 
> org.codehaus.janino.UnitCompiler.compileTryCatchFinally(UnitCompiler.java:3197)
>       at 
> org.codehaus.janino.UnitCompiler.compileTryCatchFinallyWithResources(UnitCompiler.java:3025)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2998)
>       at org.codehaus.janino.UnitCompiler.access$2300(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$6.visitTryStatement(UnitCompiler.java:1589)
>       at 
> org.codehaus.janino.UnitCompiler$6.visitTryStatement(UnitCompiler.java:1579)
>       at org.codehaus.janino.Java$TryStatement.accept(Java.java:3577)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1579)
>       at 
> org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1665)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3713)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3378)
>       at 
> org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1451)
>       at 
> org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1424)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:833)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:446)
>       at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:426)
>       at 
> org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:422)
>       at 
> org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1688)
>       at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:422)
>       at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:396)
>       at org.codehaus.janino.UnitCompiler.access$000(UnitCompiler.java:240)
>       at 
> org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:367)
>       at 
> org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:365)
>       at org.codehaus.janino.Java$CompilationUnit.accept(Java.java:371)
>       at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:365)
>       at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:273)
>       at 
> org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:303)
>       at 
> org.codehaus.janino.ClassBodyEvaluator.cook2(ClassBodyEvaluator.java:297)
>       at 
> org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:273)
>       at 
> org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:267)
>       at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:52)
>       at 
> org.codehaus.janino.ClassBodyEvaluator.createInstance(ClassBodyEvaluator.java:413)
>       at 
> org.apache.ignite.internal.sql.engine.util.Commons.compile(Commons.java:367)
> {noformat}
> See more examples in regex_replace.test



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

Reply via email to