Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
Actual behavior
[ERROR] 2023-11-10 17:56:05.534 [ShardingSphere-Command-0] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
java.lang.RuntimeException: Error while compiling generated Java code:
public static class Record2_0 implements java.io.Serializable {
public long f0;
public long f1;
public Record2_0() {}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Record2_0)) {
return false;
}
return this.f0 == ((Record2_0) o).f0 && this.f1 == ((Record2_0) o).f1;
}
public int hashCode() {
int h = 0;
h = org.apache.calcite.runtime.Utilities.hash(h, this.f0);
h = org.apache.calcite.runtime.Utilities.hash(h, this.f1);
return h;
}
public int compareTo(Record2_0 that) {
int c;
c = org.apache.calcite.runtime.Utilities.compare(this.f0, that.f0);
if (c != 0) {
return c;
}
c = org.apache.calcite.runtime.Utilities.compare(this.f1, that.f1);
if (c != 0) {
return c;
}
return 0;
}
public String toString() {
return "{f0=" + this.f0 + ", f1=" + this.f1 + "}";
}
}
public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {
final org.apache.calcite.linq4j.Enumerable _inputEnumerable = ((org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable) root.getRootSchema().getSubSchema("test").getTable("t1")).execute(root, "SELECT *\nFROM `test`.`t1`", new int[] {
}).hashJoin(((org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable) root.getRootSchema().getSubSchema("test").getTable("t2")).execute(root, "SELECT *\nFROM `test`.`t2`", new int[] {
}), new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Integer v1) {
return v1;
}
public Object apply(Object v1) {
return apply(
(Integer) v1);
}
}
, new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Object[] v1) {
return (Integer) v1[0];
}
public Object apply(Object v1) {
return apply(
(Object[]) v1);
}
}
, new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(Integer left, Object[] right) {
return new Object[] {
left,
right == null ? null : right[0],
right == null ? null : right[1]};
}
public Object[] apply(Object left, Object right) {
return apply(
(Integer) left,
(Object[]) right);
}
}
, null, false, true, null);
final org.apache.calcite.linq4j.AbstractEnumerable child = new org.apache.calcite.linq4j.AbstractEnumerable(){
public org.apache.calcite.linq4j.Enumerator enumerator() {
return new org.apache.calcite.linq4j.Enumerator(){
public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable.enumerator();
public void reset() {
inputEnumerator.reset();
}
public boolean moveNext() {
return inputEnumerator.moveNext();
}
public void close() {
inputEnumerator.close();
}
public Object current() {
final Object[] current = (Object[]) inputEnumerator.current();
return new Object[] {
current[0],
current[2],
1,
null};
}
};
}
};
java.util.List accumulatorAdders = new java.util.LinkedList();
accumulatorAdders.add(new org.apache.calcite.linq4j.function.Function2() {
public org.apache.calcite.runtime.Unit apply(org.apache.calcite.runtime.Unit acc, Object[] in) {
return acc;
}
public org.apache.calcite.runtime.Unit apply(Object acc, Object in) {
return apply(
(org.apache.calcite.runtime.Unit) acc,
(Object[]) in);
}
}
);
org.apache.calcite.adapter.enumerable.AggregateLambdaFactory lambdaFactory = new org.apache.calcite.adapter.enumerable.BasicAggregateLambdaFactory(
new org.apache.calcite.linq4j.function.Function0() {
public Object apply() {
return org.apache.calcite.runtime.Unit.INSTANCE;
}
}
,
accumulatorAdders);
final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = org.apache.calcite.linq4j.EnumerableDefaults.groupByMultiple(child, java.util.Arrays.asList(new org.apache.calcite.linq4j.function.Function1() {
public java.util.List apply(Object[] a0) {
return org.apache.calcite.runtime.FlatLists.copyOf(new Comparable[] {
(Integer) a0[0],
(Integer) a0[1],
0,
null,
false,
false,
true,
true});
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
, new org.apache.calcite.linq4j.function.Function1() {
public java.util.List apply(Object[] a0) {
return org.apache.calcite.runtime.FlatLists.copyOf(new Comparable[] {
(Integer) a0[0],
null,
org.apache.calcite.runtime.SqlFunctions.toInt(a0[2]),
(Void) a0[3],
false,
true,
false,
false});
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
), lambdaFactory.accumulatorInitializer(), lambdaFactory.accumulatorAdder(), lambdaFactory.resultSelector(new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(org.apache.calcite.runtime.FlatLists.ComparableList key, org.apache.calcite.runtime.Unit acc) {
return new Object[] {
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(4)) ? null : (Integer) key.get(0),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(5)) ? null : (Integer) key.get(1),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(6)) ? null : Integer.valueOf(org.apache.calcite.runtime.SqlFunctions.toInt(key.get(2))),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(7)) ? null : (Void) key.get(3),
( org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(4)) ? 8L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(5)) ? 4L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(6)) ? 2L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(7)) ? 1L : 0L)};
}
public Object[] apply(Object key, Object acc) {
return apply(
(org.apache.calcite.runtime.FlatLists.ComparableList) key,
(org.apache.calcite.runtime.Unit) acc);
}
}
));
final org.apache.calcite.linq4j.AbstractEnumerable child0 = new org.apache.calcite.linq4j.AbstractEnumerable(){
public org.apache.calcite.linq4j.Enumerator enumerator() {
return new org.apache.calcite.linq4j.Enumerator(){
public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable0.enumerator();
public void reset() {
inputEnumerator.reset();
}
public boolean moveNext() {
return inputEnumerator.moveNext();
}
public void close() {
inputEnumerator.close();
}
public Object current() {
final Object[] current = (Object[]) inputEnumerator.current();
final long input_value3 = org.apache.calcite.runtime.SqlFunctions.toLong(current[4]);
return new Object[] {
current[0],
current[1],
current[2],
current[3],
input_value3 == 3L,
input_value3 == 4L};
}
};
}
};
java.util.List accumulatorAdders0 = new java.util.LinkedList();
accumulatorAdders0.add(new org.apache.calcite.linq4j.function.Function2() {
public Record2_0 apply(Record2_0 acc, Object[] in) {
if ((Integer) in[1] != null && org.apache.calcite.runtime.SqlFunctions.toBoolean(in[4])) {
acc.f0++;
}
return acc;
}
public Record2_0 apply(Object acc, Object in) {
return apply(
(Record2_0) acc,
(Object[]) in);
}
}
);
accumulatorAdders0.add(new org.apache.calcite.linq4j.function.Function2() {
public Record2_0 apply(Record2_0 acc, Object[] in) {
if ((Integer) in[2] != null && (Void) in[3] != null && org.apache.calcite.runtime.SqlFunctions.toBoolean(in[5])) {
acc.f1++;
}
return acc;
}
public Record2_0 apply(Object acc, Object in) {
return apply(
(Record2_0) acc,
(Object[]) in);
}
}
);
org.apache.calcite.adapter.enumerable.AggregateLambdaFactory lambdaFactory0 = new org.apache.calcite.adapter.enumerable.BasicAggregateLambdaFactory(
new org.apache.calcite.linq4j.function.Function0() {
public Object apply() {
long a0s0;
a0s0 = 0L;
long a1s0;
a1s0 = 0L;
Record2_0 record0;
record0 = new Record2_0();
record0.f0 = a0s0;
record0.f1 = a1s0;
return record0;
}
}
,
accumulatorAdders0);
return child0.groupBy(new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Object[] a0) {
return (Integer) a0[0];
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
, lambdaFactory0.accumulatorInitializer(), lambdaFactory0.accumulatorAdder(), lambdaFactory0.resultSelector(new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(Integer key, Record2_0 acc) {
return new Object[] {
key,
acc.f0,
acc.f1};
}
public Object[] apply(Object key, Object acc) {
return apply(
(Integer) key,
(Record2_0) acc);
}
}
));
}
public Class getElementType() {
return java.lang.Object[].class;
}
at org.apache.calcite.avatica.Helper.wrap(Helper.java:37)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:128)
at org.apache.shardingsphere.sqlfederation.engine.SQLFederationEngine.executeQuery(SQLFederationEngine.java:159)
at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecuteFederation(DatabaseConnector.java:252)
at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:165)
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:99)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.codehaus.commons.compiler.CompileException: Line 149, Column 16: Assignment conversion not possible from type "java.lang.Void" to type "java.lang.Comparable"
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:13014)
at org.codehaus.janino.UnitCompiler.assignmentConversion(UnitCompiler.java:11263)
at org.codehaus.janino.UnitCompiler.access$3900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2764)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5824)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5797)
at org.codehaus.janino.UnitCompiler.access$9900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4746)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:5770)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2848)
at org.codehaus.janino.UnitCompiler.access$2800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$6.visitReturnStatement(UnitCompiler.java:1590)
at org.codehaus.janino.UnitCompiler$6.visitReturnStatement(UnitCompiler.java:1575)
at org.codehaus.janino.Java$ReturnStatement.accept(Java.java:3888)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1575)
at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1661)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3658)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3329)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1447)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1420)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:829)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1026)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:996)
at org.codehaus.janino.UnitCompiler.access$200(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$3.visitAnonymousClassDeclaration(UnitCompiler.java:420)
at org.codehaus.janino.UnitCompiler$3.visitAnonymousClassDeclaration(UnitCompiler.java:418)
at org.codehaus.janino.Java$AnonymousClassDeclaration.accept(Java.java:1377)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:418)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5712)
at org.codehaus.janino.UnitCompiler.access$9700(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewAnonymousClassInstance(UnitCompiler.java:4744)
at org.codehaus.janino.UnitCompiler$16.visitNewAnonymousClassInstance(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewAnonymousClassInstance.accept(Java.java:5635)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.access$3800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2766)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5824)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5797)
at org.codehaus.janino.UnitCompiler.access$9900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4746)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:5770)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.access$3800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2766)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2741)
at org.codehaus.janino.UnitCompiler.access$2700(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement(UnitCompiler.java:1589)
at org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement(UnitCompiler.java:1575)
at org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.java:3842)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1575)
at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1661)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3658)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3329)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1447)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1420)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:829)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:442)
at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:422)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:418)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1688)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:418)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:392)
at org.codehaus.janino.UnitCompiler.access$000(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:363)
at org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:361)
at org.codehaus.janino.Java$CompilationUnit.accept(Java.java:371)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:361)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:264)
at org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:517)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:241)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:219)
at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:82)
at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:77)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.compileToBindable(EnumerableInterpretable.java:174)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.getBindable(EnumerableInterpretable.java:168)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:125)
... 11 common frames omitted
17:56:05.534 [ShardingSphere-Command-0] ERROR org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask -- Exception occur:
java.lang.RuntimeException: Error while compiling generated Java code:
public static class Record2_0 implements java.io.Serializable {
public long f0;
public long f1;
public Record2_0() {}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Record2_0)) {
return false;
}
return this.f0 == ((Record2_0) o).f0 && this.f1 == ((Record2_0) o).f1;
}
public int hashCode() {
int h = 0;
h = org.apache.calcite.runtime.Utilities.hash(h, this.f0);
h = org.apache.calcite.runtime.Utilities.hash(h, this.f1);
return h;
}
public int compareTo(Record2_0 that) {
int c;
c = org.apache.calcite.runtime.Utilities.compare(this.f0, that.f0);
if (c != 0) {
return c;
}
c = org.apache.calcite.runtime.Utilities.compare(this.f1, that.f1);
if (c != 0) {
return c;
}
return 0;
}
public String toString() {
return "{f0=" + this.f0 + ", f1=" + this.f1 + "}";
}
}
public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {
final org.apache.calcite.linq4j.Enumerable _inputEnumerable = ((org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable) root.getRootSchema().getSubSchema("test").getTable("t1")).execute(root, "SELECT *\nFROM `test`.`t1`", new int[] {
}).hashJoin(((org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable) root.getRootSchema().getSubSchema("test").getTable("t2")).execute(root, "SELECT *\nFROM `test`.`t2`", new int[] {
}), new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Integer v1) {
return v1;
}
public Object apply(Object v1) {
return apply(
(Integer) v1);
}
}
, new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Object[] v1) {
return (Integer) v1[0];
}
public Object apply(Object v1) {
return apply(
(Object[]) v1);
}
}
, new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(Integer left, Object[] right) {
return new Object[] {
left,
right == null ? null : right[0],
right == null ? null : right[1]};
}
public Object[] apply(Object left, Object right) {
return apply(
(Integer) left,
(Object[]) right);
}
}
, null, false, true, null);
final org.apache.calcite.linq4j.AbstractEnumerable child = new org.apache.calcite.linq4j.AbstractEnumerable(){
public org.apache.calcite.linq4j.Enumerator enumerator() {
return new org.apache.calcite.linq4j.Enumerator(){
public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable.enumerator();
public void reset() {
inputEnumerator.reset();
}
public boolean moveNext() {
return inputEnumerator.moveNext();
}
public void close() {
inputEnumerator.close();
}
public Object current() {
final Object[] current = (Object[]) inputEnumerator.current();
return new Object[] {
current[0],
current[2],
1,
null};
}
};
}
};
java.util.List accumulatorAdders = new java.util.LinkedList();
accumulatorAdders.add(new org.apache.calcite.linq4j.function.Function2() {
public org.apache.calcite.runtime.Unit apply(org.apache.calcite.runtime.Unit acc, Object[] in) {
return acc;
}
public org.apache.calcite.runtime.Unit apply(Object acc, Object in) {
return apply(
(org.apache.calcite.runtime.Unit) acc,
(Object[]) in);
}
}
);
org.apache.calcite.adapter.enumerable.AggregateLambdaFactory lambdaFactory = new org.apache.calcite.adapter.enumerable.BasicAggregateLambdaFactory(
new org.apache.calcite.linq4j.function.Function0() {
public Object apply() {
return org.apache.calcite.runtime.Unit.INSTANCE;
}
}
,
accumulatorAdders);
final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = org.apache.calcite.linq4j.EnumerableDefaults.groupByMultiple(child, java.util.Arrays.asList(new org.apache.calcite.linq4j.function.Function1() {
public java.util.List apply(Object[] a0) {
return org.apache.calcite.runtime.FlatLists.copyOf(new Comparable[] {
(Integer) a0[0],
(Integer) a0[1],
0,
null,
false,
false,
true,
true});
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
, new org.apache.calcite.linq4j.function.Function1() {
public java.util.List apply(Object[] a0) {
return org.apache.calcite.runtime.FlatLists.copyOf(new Comparable[] {
(Integer) a0[0],
null,
org.apache.calcite.runtime.SqlFunctions.toInt(a0[2]),
(Void) a0[3],
false,
true,
false,
false});
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
), lambdaFactory.accumulatorInitializer(), lambdaFactory.accumulatorAdder(), lambdaFactory.resultSelector(new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(org.apache.calcite.runtime.FlatLists.ComparableList key, org.apache.calcite.runtime.Unit acc) {
return new Object[] {
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(4)) ? null : (Integer) key.get(0),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(5)) ? null : (Integer) key.get(1),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(6)) ? null : Integer.valueOf(org.apache.calcite.runtime.SqlFunctions.toInt(key.get(2))),
org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(7)) ? null : (Void) key.get(3),
( org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(4)) ? 8L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(5)) ? 4L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(6)) ? 2L : 0L) + (org.apache.calcite.runtime.SqlFunctions.toBoolean(key.get(7)) ? 1L : 0L)};
}
public Object[] apply(Object key, Object acc) {
return apply(
(org.apache.calcite.runtime.FlatLists.ComparableList) key,
(org.apache.calcite.runtime.Unit) acc);
}
}
));
final org.apache.calcite.linq4j.AbstractEnumerable child0 = new org.apache.calcite.linq4j.AbstractEnumerable(){
public org.apache.calcite.linq4j.Enumerator enumerator() {
return new org.apache.calcite.linq4j.Enumerator(){
public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable0.enumerator();
public void reset() {
inputEnumerator.reset();
}
public boolean moveNext() {
return inputEnumerator.moveNext();
}
public void close() {
inputEnumerator.close();
}
public Object current() {
final Object[] current = (Object[]) inputEnumerator.current();
final long input_value3 = org.apache.calcite.runtime.SqlFunctions.toLong(current[4]);
return new Object[] {
current[0],
current[1],
current[2],
current[3],
input_value3 == 3L,
input_value3 == 4L};
}
};
}
};
java.util.List accumulatorAdders0 = new java.util.LinkedList();
accumulatorAdders0.add(new org.apache.calcite.linq4j.function.Function2() {
public Record2_0 apply(Record2_0 acc, Object[] in) {
if ((Integer) in[1] != null && org.apache.calcite.runtime.SqlFunctions.toBoolean(in[4])) {
acc.f0++;
}
return acc;
}
public Record2_0 apply(Object acc, Object in) {
return apply(
(Record2_0) acc,
(Object[]) in);
}
}
);
accumulatorAdders0.add(new org.apache.calcite.linq4j.function.Function2() {
public Record2_0 apply(Record2_0 acc, Object[] in) {
if ((Integer) in[2] != null && (Void) in[3] != null && org.apache.calcite.runtime.SqlFunctions.toBoolean(in[5])) {
acc.f1++;
}
return acc;
}
public Record2_0 apply(Object acc, Object in) {
return apply(
(Record2_0) acc,
(Object[]) in);
}
}
);
org.apache.calcite.adapter.enumerable.AggregateLambdaFactory lambdaFactory0 = new org.apache.calcite.adapter.enumerable.BasicAggregateLambdaFactory(
new org.apache.calcite.linq4j.function.Function0() {
public Object apply() {
long a0s0;
a0s0 = 0L;
long a1s0;
a1s0 = 0L;
Record2_0 record0;
record0 = new Record2_0();
record0.f0 = a0s0;
record0.f1 = a1s0;
return record0;
}
}
,
accumulatorAdders0);
return child0.groupBy(new org.apache.calcite.linq4j.function.Function1() {
public Integer apply(Object[] a0) {
return (Integer) a0[0];
}
public Object apply(Object a0) {
return apply(
(Object[]) a0);
}
}
, lambdaFactory0.accumulatorInitializer(), lambdaFactory0.accumulatorAdder(), lambdaFactory0.resultSelector(new org.apache.calcite.linq4j.function.Function2() {
public Object[] apply(Integer key, Record2_0 acc) {
return new Object[] {
key,
acc.f0,
acc.f1};
}
public Object[] apply(Object key, Object acc) {
return apply(
(Integer) key,
(Record2_0) acc);
}
}
));
}
public Class getElementType() {
return java.lang.Object[].class;
}
at org.apache.calcite.avatica.Helper.wrap(Helper.java:37)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:128)
at org.apache.shardingsphere.sqlfederation.engine.SQLFederationEngine.executeQuery(SQLFederationEngine.java:159)
at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecuteFederation(DatabaseConnector.java:252)
at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:165)
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:99)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.codehaus.commons.compiler.CompileException: Line 149, Column 16: Assignment conversion not possible from type "java.lang.Void" to type "java.lang.Comparable"
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:13014)
at org.codehaus.janino.UnitCompiler.assignmentConversion(UnitCompiler.java:11263)
at org.codehaus.janino.UnitCompiler.access$3900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2764)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5824)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5797)
at org.codehaus.janino.UnitCompiler.access$9900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4746)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:5770)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2848)
at org.codehaus.janino.UnitCompiler.access$2800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$6.visitReturnStatement(UnitCompiler.java:1590)
at org.codehaus.janino.UnitCompiler$6.visitReturnStatement(UnitCompiler.java:1575)
at org.codehaus.janino.Java$ReturnStatement.accept(Java.java:3888)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1575)
at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1661)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3658)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3329)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1447)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1420)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:829)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1026)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:996)
at org.codehaus.janino.UnitCompiler.access$200(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$3.visitAnonymousClassDeclaration(UnitCompiler.java:420)
at org.codehaus.janino.UnitCompiler$3.visitAnonymousClassDeclaration(UnitCompiler.java:418)
at org.codehaus.janino.Java$AnonymousClassDeclaration.accept(Java.java:1377)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:418)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5712)
at org.codehaus.janino.UnitCompiler.access$9700(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewAnonymousClassInstance(UnitCompiler.java:4744)
at org.codehaus.janino.UnitCompiler$16.visitNewAnonymousClassInstance(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewAnonymousClassInstance.accept(Java.java:5635)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.access$3800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2766)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5824)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5797)
at org.codehaus.janino.UnitCompiler.access$9900(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4746)
at org.codehaus.janino.UnitCompiler$16.visitNewInitializedArray(UnitCompiler.java:4711)
at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:5770)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5360)
at org.codehaus.janino.UnitCompiler.access$9300(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4735)
at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4711)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5470)
at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4711)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5854)
at org.codehaus.janino.UnitCompiler.access$3800(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2766)
at org.codehaus.janino.UnitCompiler$7.visitRvalue(UnitCompiler.java:2754)
at org.codehaus.janino.Java$Rvalue.accept(Java.java:4498)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2754)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2741)
at org.codehaus.janino.UnitCompiler.access$2700(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement(UnitCompiler.java:1589)
at org.codehaus.janino.UnitCompiler$6.visitLocalVariableDeclarationStatement(UnitCompiler.java:1575)
at org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.java:3842)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1575)
at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1661)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3658)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3329)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1447)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1420)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:829)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:442)
at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:422)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:418)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1688)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:418)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:392)
at org.codehaus.janino.UnitCompiler.access$000(UnitCompiler.java:236)
at org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:363)
at org.codehaus.janino.UnitCompiler$2.visitCompilationUnit(UnitCompiler.java:361)
at org.codehaus.janino.Java$CompilationUnit.accept(Java.java:371)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:361)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:264)
at org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:517)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:241)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:219)
at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:82)
at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:77)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.compileToBindable(EnumerableInterpretable.java:174)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.getBindable(EnumerableInterpretable.java:168)
at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:125)
... 11 common frames omitted
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Which version of ShardingSphere did you use?
Ref: #28895
mysql version: 5.7.43 master e66222ad6c1ca3b97f3f2
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
Actual behavior
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
server.yaml