[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:58 min
[INFO] Finished at: 2019-07-24T16:37:45+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project flink-table-api-java: Compilation failure
[ERROR] /E:/devlop/sourcespace/flink/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/OperationTreeBuilder.java:[560,85] 未报告的异常错误X; 必须对其进行捕获或声明以便抛出
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :flink-table-api-java
这个问题 未报告的异常错误X; 必须对其进行捕获或声明以便抛出
问题卡了我好久,查看源码
private CalculatedQueryOperation<?> unwrapFromAlias(CallExpression call) {
List children = call.getChildren();
List aliases = children.subList(1, children.size())
.stream()
.map(alias -> ExpressionUtils.extractValue(alias, String.class)
.orElseThrow(() -> new ValidationException("Unexpected alias: " + alias))) <= 这里是异常提示
.collect(toList());
if (!isFunctionOfKind(children.get(0), TABLE)) {
throw fail();
}
CallExpression tableCall = (CallExpression) children.get(0);
TableFunctionDefinition tableFunctionDefinition =
(TableFunctionDefinition) tableCall.getFunctionDefinition();
return createFunctionCall(tableFunctionDefinition, aliases, tableCall.getResolvedChildren());
}
再看一下ValidationException
的代码
@PublicEvolving
public class ValidationException extends RuntimeException {
public ValidationException(String message, Throwable cause) {
super(message, cause);
}
public ValidationException(String message) {
super(message);
}
}
似乎也没啥问题,然后翻了半天,终于在stackoverflow上找到问题所在了https://stackoverflow.com/questions/2