diff --git a/dev-tools/checkstyle_suppressions.xml b/dev-tools/checkstyle_suppressions.xml index 90712818c07..92ce05ff4b5 100644 --- a/dev-tools/checkstyle_suppressions.xml +++ b/dev-tools/checkstyle_suppressions.xml @@ -8,10 +8,6 @@ - - - - diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/optimizer/Optimizer.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/optimizer/Optimizer.java index bfb7254f5ef..9c9a54509bb 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/optimizer/Optimizer.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/optimizer/Optimizer.java @@ -317,7 +317,8 @@ public class Optimizer extends RuleExecutor { return e; } - protected Expression rule(Expression e, Map seen, Map promotedIds) { + protected Expression rule(Expression e, Map seen, + Map promotedIds) { if (e instanceof ExtendedStatsEnclosed) { AggregateFunction f = (AggregateFunction) e; @@ -582,7 +583,8 @@ public class Optimizer extends RuleExecutor { } } - protected Expression rule(Expression e, Map percentilesPerField, Map promotedIds) { + protected Expression rule(Expression e, Map percentilesPerField, + Map promotedIds) { if (e instanceof Percentile) { Percentile p = (Percentile) e; Percentiles percentiles = percentilesPerField.get(p.field()); @@ -639,7 +641,8 @@ public class Optimizer extends RuleExecutor { } } - protected Expression rule(Expression e, Map ranksPerField, Map promotedIds) { + protected Expression rule(Expression e, Map ranksPerField, + Map promotedIds) { if (e instanceof PercentileRank) { PercentileRank p = (PercentileRank) e; PercentileRanks ranks = ranksPerField.get(p.field()); @@ -1034,7 +1037,12 @@ public class Optimizer extends RuleExecutor { } private boolean canPropagateFoldable(LogicalPlan p) { - return p instanceof Project || p instanceof Filter || p instanceof SubQueryAlias || p instanceof Aggregate || p instanceof Limit || p instanceof OrderBy; + return p instanceof Project + || p instanceof Filter + || p instanceof SubQueryAlias + || p instanceof Aggregate + || p instanceof Limit + || p instanceof OrderBy; } } @@ -1374,7 +1382,8 @@ public class Optimizer extends RuleExecutor { @Override public final LogicalPlan apply(LogicalPlan plan) { - return direction == TransformDirection.DOWN ? plan.transformDown(this::rule, typeToken()) : plan.transformUp(this::rule, typeToken()); + return direction == TransformDirection.DOWN ? + plan.transformDown(this::rule, typeToken()) : plan.transformUp(this::rule, typeToken()); } @Override @@ -1406,4 +1415,4 @@ public class Optimizer extends RuleExecutor { enum TransformDirection { UP, DOWN }; -} \ No newline at end of file +} diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/Explain.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/Explain.java index 8b2aa78e90c..3a46126bc9f 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/Explain.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/Explain.java @@ -117,7 +117,8 @@ public class Explain extends Command { } // Type.All - listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, mappedPlan, executablePlan))); + listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, + mappedPlan, executablePlan))); }, listener::onFailure)); } @@ -146,7 +147,8 @@ public class Explain extends Command { return; } - listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, mappedPlan, executablePlan))); + listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, + mappedPlan, executablePlan))); return; } // mapped failed @@ -155,7 +157,8 @@ public class Explain extends Command { return; } - listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, mappedPlan, null))); + listener.onResponse(Rows.singleton(output(), printPlans(format, plan, analyzedPlan, optimizedPlan, + mappedPlan, null))); }, listener::onFailure)); // cannot continue } else { @@ -170,7 +173,8 @@ public class Explain extends Command { }, listener::onFailure)); } - private static String printPlans(Format format, LogicalPlan parsed, LogicalPlan analyzedPlan, LogicalPlan optimizedPlan, PhysicalPlan mappedPlan, PhysicalPlan executionPlan) { + private static String printPlans(Format format, LogicalPlan parsed, LogicalPlan analyzedPlan, LogicalPlan optimizedPlan, + PhysicalPlan mappedPlan, PhysicalPlan executionPlan) { if (format == Format.TEXT) { StringBuilder sb = new StringBuilder(); sb.append("Parsed\n"); diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/tree/NodeUtils.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/tree/NodeUtils.java index 02e6ffcdda3..2c93a1cb463 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/tree/NodeUtils.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/tree/NodeUtils.java @@ -78,7 +78,8 @@ public abstract class NodeUtils { // basic sanity check List currentChildren = tree.children(); - Check.isTrue(currentChildren.size() == newChildren.size(), "Cannot make copy; expected %s children but received %s", currentChildren.size(), newChildren.size()); + Check.isTrue(currentChildren.size() == newChildren.size(), "Cannot make copy; expected %s children but received %s", + currentChildren.size(), newChildren.size()); NodeInfo info = info(tree.getClass()); Object[] props = properties(tree, info); @@ -151,7 +152,9 @@ public abstract class NodeUtils { Parameter[] parameters = ctr.getParameters(); for (int paramIndex = 0; paramIndex < parameters.length; paramIndex++) { Parameter param = parameters[paramIndex]; - Check.isTrue(param.isNamePresent(), "Can't find constructor parameter names for [%s]. Is class debug information available?", clazz.toGenericString()); + Check.isTrue(param.isNamePresent(), + "Can't find constructor parameter names for [%s]. Is class debug information available?", + clazz.toGenericString()); String paramName = param.getName(); if (paramName.equals("children")) { @@ -162,7 +165,8 @@ public abstract class NodeUtils { try { getter = clazz.getMethod(paramName); } catch (NoSuchMethodException nsme) { - throw new SqlIllegalArgumentException("class [%s] expected to have method [%s] for retrieving constructor arguments; none found", + throw new SqlIllegalArgumentException( + "class [%s] expected to have method [%s] for retrieving constructor arguments; none found", clazz.getName(), paramName); } @@ -170,7 +174,9 @@ public abstract class NodeUtils { Class expected = param.getType(); Class found = getter.getReturnType(); // found == Object if we're dealing with generics - Check.isTrue(found == Object.class || expected.isAssignableFrom(found), "Constructor param [%s] in class [%s] has type [%s] but found getter [%s]", paramName, clazz, expected, getter.toGenericString()); + Check.isTrue(found == Object.class || expected.isAssignableFrom(found), + "Constructor param [%s] in class [%s] has type [%s] but found getter [%s]", paramName, clazz, + expected, getter.toGenericString()); params.put(paramName, getter); } @@ -368,4 +374,4 @@ public abstract class NodeUtils { } return sb.toString(); } -} \ No newline at end of file +}