diff --git a/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/CsvSpecIT.java b/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/CsvSpecIT.java index 2d52709b561..5dc3032bd25 100644 --- a/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/CsvSpecIT.java +++ b/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/CsvSpecIT.java @@ -91,6 +91,10 @@ public class CsvSpecIT extends SpecBaseIntegrationTestCase { } } + protected void assertResults(ResultSet expected, ResultSet actual) throws SQLException { + assertResultSets(expected, actual); + } + private ResultSet executeJdbcQuery(Connection con, String query) throws SQLException { Statement statement = con.createStatement(); //statement.setFetchSize(randomInt(10)); diff --git a/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/DebugCsvSpec.java b/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/DebugCsvSpec.java index cce97a95aa8..cd061a5d0a6 100644 --- a/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/DebugCsvSpec.java +++ b/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/DebugCsvSpec.java @@ -7,16 +7,20 @@ package org.elasticsearch.xpack.sql.jdbc; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.xpack.sql.jdbc.framework.JdbcTestUtils; import java.nio.file.Path; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.List; -public abstract class DebugCsvSpec extends CsvSpecIT { +@TestLogging("org.elasticsearch.xpack.sql:TRACE") +public class DebugCsvSpec extends CsvSpecIT { @ParametersFactory(shuffle = false, argumentFormatting = SqlSpecIT.PARAM_FORMATTING) // NOCOMMIT are we sure?! public static List readScriptSpec() throws Exception { - JdbcTestUtils.sqlLogging(); + //JdbcTestUtils.sqlLogging(); CsvSpecParser parser = new CsvSpecParser(); return readScriptSpec("/debug.csv-spec", parser); @@ -26,11 +30,8 @@ public abstract class DebugCsvSpec extends CsvSpecIT { super(groupName, testName, lineNumber, source, testCase); } - // @Override - // public void assertResults(ResultSet expected, ResultSet actual) throws SQLException { - // Logger logger = Loggers.getLogger("org.elasticsearch.xpack.sql.test"); - // Loggers.setLevel(logger, "INFO"); - // - // JdbcTestUtils.resultSetToLogger(logger, actual); - // } + @Override + public void assertResults(ResultSet expected, ResultSet actual) throws SQLException { + JdbcTestUtils.resultSetToLogger(logger, actual); + } } \ No newline at end of file diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Avg.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Avg.java index 4e722915491..64a56adeb33 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Avg.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Avg.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class Avg extends NumericAggregate implements EnclosedAgg { - public Avg(Location location, Expression argument) { - super(location, argument); + public Avg(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Count.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Count.java index cb04a92c6d8..3ccfb384a30 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Count.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Count.java @@ -25,6 +25,11 @@ public class Count extends NumericAggregate implements DistinctAware { return distinct; } + @Override + protected TypeResolution resolveType() { + return TypeResolution.TYPE_RESOLVED; + } + @Override public DataType dataType() { return DataTypes.LONG; diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Kurtosis.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Kurtosis.java index b5ce38a03ad..ef7c280324a 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Kurtosis.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Kurtosis.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class Kurtosis extends NumericAggregate implements MatrixStatsEnclosed { - public Kurtosis(Location location, Expression argument) { - super(location, argument); + public Kurtosis(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Max.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Max.java index 7d819fcea41..011087e35f7 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Max.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Max.java @@ -11,8 +11,8 @@ import org.elasticsearch.xpack.sql.type.DataType; public class Max extends NumericAggregate implements EnclosedAgg { - public Max(Location location, Expression argument) { - super(location, argument); + public Max(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Mean.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Mean.java index 7f2bde4802f..2c1755fe546 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Mean.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Mean.java @@ -12,8 +12,8 @@ import org.elasticsearch.xpack.sql.type.DataTypes; public class Mean extends NumericAggregate implements MatrixStatsEnclosed { - public Mean(Location location, Expression argument) { - super(location, argument); + public Mean(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Min.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Min.java index 51600f7af4b..2e098da9a07 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Min.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Min.java @@ -11,8 +11,8 @@ import org.elasticsearch.xpack.sql.type.DataType; public class Min extends NumericAggregate implements EnclosedAgg { - public Min(Location location, Expression argument) { - super(location, argument); + public Min(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Skewness.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Skewness.java index e249937b1d4..605812a82dc 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Skewness.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Skewness.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class Skewness extends NumericAggregate implements MatrixStatsEnclosed { - public Skewness(Location location, Expression argument) { - super(location, argument); + public Skewness(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/StddevPop.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/StddevPop.java index f560765d5d3..a9eee0b6dae 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/StddevPop.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/StddevPop.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class StddevPop extends NumericAggregate implements ExtendedStatsEnclosed { - public StddevPop(Location location, Expression argument) { - super(location, argument); + public StddevPop(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Sum.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Sum.java index 7bd91d6b23a..3b6becd0236 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Sum.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/Sum.java @@ -11,8 +11,8 @@ import org.elasticsearch.xpack.sql.type.DataType; public class Sum extends NumericAggregate implements EnclosedAgg { - public Sum(Location location, Expression argument) { - super(location, argument); + public Sum(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/SumOfSquares.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/SumOfSquares.java index f60a4a6f3c2..ecf0bacc840 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/SumOfSquares.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/SumOfSquares.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class SumOfSquares extends NumericAggregate implements ExtendedStatsEnclosed { - public SumOfSquares(Location location, Expression argument) { - super(location, argument); + public SumOfSquares(Location location, Expression field) { + super(location, field); } @Override diff --git a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/VarPop.java b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/VarPop.java index bccf459a6d8..546e2df4bf1 100644 --- a/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/VarPop.java +++ b/sql/server/src/main/java/org/elasticsearch/xpack/sql/expression/function/aggregate/VarPop.java @@ -10,8 +10,8 @@ import org.elasticsearch.xpack.sql.tree.Location; public class VarPop extends NumericAggregate implements ExtendedStatsEnclosed { - public VarPop(Location location, Expression argument) { - super(location, argument); + public VarPop(Location location, Expression field) { + super(location, field); } @Override