Update test dataset name

Original commit: elastic/x-pack-elasticsearch@49951836c1
This commit is contained in:
Costin Leau 2017-07-04 00:00:11 +03:00
parent 3eb1258b0d
commit 405b4a4166
12 changed files with 189 additions and 171 deletions

View File

@ -64,7 +64,7 @@ dependencies {
// watcher deps
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239'
compile 'com.google.guava:guava:16.0.1' // needed by watcher for the html sanitizer and security tests for jimfs
compile 'com.google.guava:guava:18.0' // needed by watcher for the html sanitizer and security tests for jimfs
compile 'com.sun.mail:javax.mail:1.5.6'
// HACK: java 9 removed javax.activation from the default modules, so instead of trying to add modules, which would have
// to be conditionalized for java 8/9, we pull in the classes directly

View File

@ -5,12 +5,12 @@
*/
package org.elasticsearch.xpack.sql.jdbc.csv;
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import org.elasticsearch.common.CheckedSupplier;
import org.elasticsearch.xpack.sql.jdbc.framework.CsvSpecTableReader;
import org.elasticsearch.xpack.sql.jdbc.framework.SpecBaseIntegrationTestCase;
import org.elasticsearch.xpack.sql.jdbc.framework.SpecBaseIntegrationTestCase.Parser;
import org.elasticsearch.xpack.sql.util.CollectionUtils;
import org.junit.AfterClass;
import org.junit.Test;
@ -54,7 +54,7 @@ public class CsvSpecIntegrationTest extends SpecBaseIntegrationTestCase {
};
}
@ParametersFactory(shuffle = false, argumentFormatting = "name=%1s")
@ParametersFactory(shuffle = false, argumentFormatting = PARAM_FORMATTNG)
public static List<Object[]> readScriptSpec() throws Exception {
CsvSpecParser parser = new CsvSpecParser();
return CollectionUtils.combine(
@ -63,7 +63,7 @@ public class CsvSpecIntegrationTest extends SpecBaseIntegrationTestCase {
}
public CsvSpecIntegrationTest(String groupName, String testName, Integer lineNumber, Path source, CsvFragment fragment) {
public CsvSpecIntegrationTest(String groupName, @Name("testName") String testName, Integer lineNumber, Path source, CsvFragment fragment) {
super(groupName, testName, lineNumber, source);
this.fragment = fragment;
}

View File

@ -18,6 +18,7 @@ import static org.junit.Assert.assertNotNull;
public class EsJdbcServer extends ExternalResource implements CheckedSupplier<Connection, SQLException> {
private Client client;
private JdbcHttpServer server;
private String jdbcUrl;
private JdbcDriver driver;
@ -36,7 +37,8 @@ public class EsJdbcServer extends ExternalResource implements CheckedSupplier<Co
@Override
protected void before() throws Throwable {
server = new JdbcHttpServer(TestUtils.client());
client = TestUtils.client();
server = new JdbcHttpServer(client);
driver = new JdbcDriver();
server.start(0);
@ -47,6 +49,8 @@ public class EsJdbcServer extends ExternalResource implements CheckedSupplier<Co
@Override
protected void after() {
client.close();
client = null;
server.stop();
server = null;

View File

@ -12,6 +12,7 @@ import org.junit.rules.ExternalResource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import java.util.TimeZone;
public class LocalH2 extends ExternalResource implements CheckedSupplier<Connection, SQLException> {
@ -33,14 +34,20 @@ public class LocalH2 extends ExternalResource implements CheckedSupplier<Connect
* for MySQL and, by default, H2. Our jdbc driver does it.
*/
public LocalH2() {
this.url = "jdbc:H2:mem:essql;DATABASE_TO_UPPER=false;ALIAS_COLUMN_NAME=true";
this.url = "jdbc:h2:mem:essql;DATABASE_TO_UPPER=false;ALIAS_COLUMN_NAME=true";
}
@Override
protected void before() throws Throwable {
keepAlive = get();
//NOCOMMIT: check timezone issue
keepAlive.createStatement().executeQuery("RUNSCRIPT FROM 'classpath:h2-setup.sql'");
TimeZone tz = TimeZone.getDefault();
try {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
keepAlive.createStatement().execute("RUNSCRIPT FROM 'classpath:/h2-setup.sql'");
} finally {
TimeZone.setDefault(tz);
}
}
@Override

View File

@ -7,7 +7,6 @@ package org.elasticsearch.xpack.sql.jdbc.framework;
import org.elasticsearch.common.Strings;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcDriver;
import org.junit.Assert;
import org.junit.ClassRule;
@ -24,10 +23,8 @@ import java.util.Map;
import static java.lang.String.format;
public abstract class SpecBaseIntegrationTestCase extends ESTestCase {
static {
// Initialize the jdbc driver
JdbcDriver.jdbcMajorVersion();
}
protected static final String PARAM_FORMATTNG = "%0$s.test%2$s";
protected final String groupName;
protected final String testName;
@ -37,6 +34,14 @@ public abstract class SpecBaseIntegrationTestCase extends ESTestCase {
@ClassRule
public static EsJdbcServer ES = new EsJdbcServer();
//
// This typically is uncommented when starting up a new instance of ES
//
// @BeforeClass
// public static void start() throws Exception {
// TestUtils.loadDatasetInEs(TestUtils.restClient("localhost", 9200));
// }
public SpecBaseIntegrationTestCase(String groupName, String testName, Integer lineNumber, Path source) {
this.groupName = groupName;
this.testName = testName;
@ -62,10 +67,12 @@ public abstract class SpecBaseIntegrationTestCase extends ESTestCase {
// spec reader
//
// returns testName, its line location, its source and the custom object (based on each test parser)
// returns groupName, testName, its line location, its source and the custom object (based on each test parser)
protected static List<Object[]> readScriptSpec(String url, Parser parser) throws Exception {
Path source = Paths.get(TestUtils.class.getResource(url).toURI());
String groupName = source.getFileName().toString();
String fileName = source.getFileName().toString();
int dot = fileName.indexOf(".");
String groupName = dot > 0 ? fileName.substring(0, dot) : fileName;
List<String> lines = Files.readAllLines(source);

View File

@ -90,7 +90,7 @@ public abstract class TestUtils {
createIndex.endObject();
}
createIndex.endObject().endObject();
client.performRequest("PUT", "/emp", emptyMap(), new StringEntity(createIndex.string(), ContentType.APPLICATION_JSON));
client.performRequest("PUT", "/test_emp", emptyMap(), new StringEntity(createIndex.string(), ContentType.APPLICATION_JSON));
StringBuilder bulk = new StringBuilder();
csvToLines("employees", (titles, fields) -> {
@ -104,7 +104,7 @@ public abstract class TestUtils {
}
bulk.append("}\n");
});
client.performRequest("POST", "/emp/emp/_bulk", singletonMap("refresh", "true"), new StringEntity(bulk.toString(), ContentType.APPLICATION_JSON));
client.performRequest("POST", "/test_emp/emp/_bulk", singletonMap("refresh", "true"), new StringEntity(bulk.toString(), ContentType.APPLICATION_JSON));
}
/**

View File

@ -10,7 +10,6 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import org.elasticsearch.xpack.sql.jdbc.framework.LocalH2;
import org.elasticsearch.xpack.sql.jdbc.framework.SpecBaseIntegrationTestCase;
import org.elasticsearch.xpack.sql.jdbc.framework.SpecBaseIntegrationTestCase.Parser;
import org.elasticsearch.xpack.sql.util.CollectionUtils;
import org.junit.ClassRule;
import org.junit.Test;
@ -32,7 +31,7 @@ public class SqlSpecIntegrationTest extends SpecBaseIntegrationTestCase {
@ClassRule
public static LocalH2 H2 = new LocalH2();
@ParametersFactory(shuffle = false, argumentFormatting = "name=%1s")
@ParametersFactory(shuffle = false, argumentFormatting = PARAM_FORMATTNG)
public static List<Object[]> readScriptSpec() throws Exception {
SqlSpecParser parser = new SqlSpecParser();
return CollectionUtils.combine(
@ -61,6 +60,7 @@ public class SqlSpecIntegrationTest extends SpecBaseIntegrationTestCase {
@Test
public void testQuery() throws Throwable {
System.out.println("Executing query " + query);
// H2 resultset
try (Connection h2 = h2Con();
Connection es = esCon()) {

View File

@ -3,33 +3,33 @@
//
groupByOnText
SELECT gender g FROM "emp.emp" GROUP BY gender;
SELECT gender g FROM "test_emp.emp" GROUP BY gender;
groupByOnTextWithWhereClause
SELECT gender g FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender;
SELECT gender g FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender;
groupByOnTextWithWhereAndLimit
SELECT gender g FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
SELECT gender g FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
groupByOnTextOnAlias
SELECT gender g FROM "emp.emp" WHERE emp_no < 10020 GROUP BY g;
SELECT gender g FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY g;
groupByOnTextOnAliasOrderDesc
SELECT gender g FROM "emp.emp" WHERE emp_no < 10020 GROUP BY g ORDER BY g DESC;
SELECT gender g FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY g ORDER BY g DESC;
groupByOnDate
SELECT birth_date b FROM "emp.emp" GROUP BY birth_date ORDER BY birth_date DESC;
SELECT birth_date b FROM "test_emp.emp" GROUP BY birth_date ORDER BY birth_date DESC;
groupByOnDateWithWhereClause
SELECT birth_date b FROM "emp.emp" WHERE emp_no < 10020 GROUP BY birth_date ORDER BY birth_date DESC;
SELECT birth_date b FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY birth_date ORDER BY birth_date DESC;
groupByOnDateWithWhereAndLimit
SELECT birth_date b FROM "emp.emp" WHERE emp_no < 10020 GROUP BY birth_date ORDER BY birth_date DESC LIMIT 1;
SELECT birth_date b FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY birth_date ORDER BY birth_date DESC LIMIT 1;
groupByOnDateOnAlias
SELECT birth_date b FROM "emp.emp" WHERE emp_no < 10020 GROUP BY b ORDER BY birth_date DESC;
SELECT birth_date b FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY b ORDER BY birth_date DESC;
groupByOnNumber
SELECT emp_no e FROM "emp.emp" GROUP BY emp_no ORDER BY emp_no DESC;
SELECT emp_no e FROM "test_emp.emp" GROUP BY emp_no ORDER BY emp_no DESC;
groupByOnNumberWithWhereClause
SELECT emp_no e FROM "emp.emp" WHERE emp_no < 10020 GROUP BY emp_no ORDER BY emp_no DESC;
SELECT emp_no e FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY emp_no ORDER BY emp_no DESC;
groupByOnNumberWithWhereAndLimit
SELECT emp_no e FROM "emp.emp" WHERE emp_no < 10020 GROUP BY emp_no ORDER BY emp_no DESC LIMIT 1;
SELECT emp_no e FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY emp_no ORDER BY emp_no DESC LIMIT 1;
groupByOnNumberOnAlias
SELECT emp_no e FROM "emp.emp" WHERE emp_no < 10020 GROUP BY e ORDER BY emp_no DESC;
SELECT emp_no e FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY e ORDER BY emp_no DESC;
//
// Aggregate Functions
@ -37,160 +37,160 @@ SELECT emp_no e FROM "emp.emp" WHERE emp_no < 10020 GROUP BY e ORDER BY emp_no D
// COUNT
aggCountImplicit
SELECT COUNT(*) c FROM "emp.emp";
SELECT COUNT(*) c FROM "test_emp.emp";
aggCountImplicitWithCast
SELECT CAST(COUNT(*) AS INT) c FROM "emp.emp";
SELECT CAST(COUNT(*) AS INT) c FROM "test_emp.emp";
aggCountImplicitWithConstant
SELECT COUNT(1) FROM "emp.emp";
SELECT COUNT(1) FROM "test_emp.emp";
aggCountImplicitWithConstantAndFilter
SELECT COUNT(1) FROM "emp.emp" WHERE emp_no < 10010;
SELECT COUNT(1) FROM "test_emp.emp" WHERE emp_no < 10010;
aggCountAliasAndWhereClause
SELECT gender g, COUNT(*) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender;
SELECT gender g, COUNT(*) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender;
aggCountAliasAndWhereClauseAndLimit
SELECT gender g, COUNT(*) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
SELECT gender g, COUNT(*) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
aggCountAliasWithCastAndFilter
SELECT gender g, CAST(COUNT(*) AS INT) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender;
SELECT gender g, CAST(COUNT(*) AS INT) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender;
aggCountWithAlias
SELECT gender g, COUNT(*) c FROM "emp.emp" GROUP BY g;
SELECT gender g, COUNT(*) c FROM "test_emp.emp" GROUP BY g;
// Conditional COUNT
aggCountAndHaving
SELECT gender g, COUNT(*) c FROM "emp.emp" GROUP BY g HAVING COUNT(*) > 10;
SELECT gender g, COUNT(*) c FROM "test_emp.emp" GROUP BY g HAVING COUNT(*) > 10;
aggCountOnColumnAndHaving
SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING COUNT(gender) > 10;
SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING COUNT(gender) > 10;
// NOT supported yet since Having introduces a new agg
//aggCountOnColumnAndWildcardAndHaving
//SELECT gender g, COUNT(*) c FROM "emp.emp" GROUP BY g HAVING COUNT(gender) > 10;
//SELECT gender g, COUNT(*) c FROM "test_emp.emp" GROUP BY g HAVING COUNT(gender) > 10;
aggCountAndHavingOnAlias
SELECT gender g, COUNT(*) c FROM "emp.emp" GROUP BY g HAVING c > 10;
SELECT gender g, COUNT(*) c FROM "test_emp.emp" GROUP BY g HAVING c > 10;
aggCountOnColumnAndHavingOnAlias
SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10;
SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10;
aggCountOnColumnAndMultipleHaving
SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10 AND c < 70;
SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10 AND c < 70;
aggCountOnColumnAndMultipleHavingWithLimit
SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10 AND c < 70 LIMIT 1;
SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10 AND c < 70 LIMIT 1;
aggCountOnColumnAndHavingOnAliasAndFunction
SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10 AND COUNT(gender) < 70;
SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10 AND COUNT(gender) < 70;
// NOT supported yet since Having introduces a new agg
//aggCountOnColumnAndHavingOnAliasAndFunctionWildcard -> COUNT(*/1) vs COUNT(gender)
//SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10 AND COUNT(*) < 70;
//SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10 AND COUNT(*) < 70;
//aggCountOnColumnAndHavingOnAliasAndFunctionConstant
//SELECT gender g, COUNT(gender) c FROM "emp.emp" GROUP BY g HAVING c > 10 AND COUNT(1) < 70;
//SELECT gender g, COUNT(gender) c FROM "test_emp.emp" GROUP BY g HAVING c > 10 AND COUNT(1) < 70;
// MIN
aggMinImplicit
SELECT MIN(emp_no) m FROM "emp.emp";
SELECT MIN(emp_no) m FROM "test_emp.emp";
aggMinImplicitWithCast
SELECT CAST(MIN(emp_no) AS SMALLINT) m FROM "emp.emp";
SELECT CAST(MIN(emp_no) AS SMALLINT) m FROM "test_emp.emp";
aggMin
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY gender;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY gender;
aggMinWithCast
SELECT CAST(MIN(emp_no) AS SMALLINT) m FROM "emp.emp" GROUP BY gender;
SELECT CAST(MIN(emp_no) AS SMALLINT) m FROM "test_emp.emp" GROUP BY gender;
aggMinAndCount
SELECT MIN(emp_no) m, COUNT(1) c FROM "emp.emp" GROUP BY gender;
SELECT MIN(emp_no) m, COUNT(1) c FROM "test_emp.emp" GROUP BY gender;
aggMinAndCountWithFilter
SELECT MIN(emp_no) m, COUNT(1) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender ;
SELECT MIN(emp_no) m, COUNT(1) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender ;
aggMinAndCountWithFilterAndLimit
SELECT MIN(emp_no) m, COUNT(1) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
SELECT MIN(emp_no) m, COUNT(1) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender LIMIT 1;
aggMinWithCastAndFilter
SELECT gender g, CAST(MIN(emp_no) AS SMALLINT) m, COUNT(1) c FROM "emp.emp" WHERE emp_no < 10020 GROUP BY gender;
SELECT gender g, CAST(MIN(emp_no) AS SMALLINT) m, COUNT(1) c FROM "test_emp.emp" WHERE emp_no < 10020 GROUP BY gender;
aggMinWithAlias
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g;
// Conditional MIN
aggMinWithHaving
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g HAVING MIN(emp_no) > 10;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING MIN(emp_no) > 10;
aggMinWithHavingOnAlias
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10;
aggMinWithMultipleHaving
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND m < 99999;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND m < 99999;
aggMinWithMultipleHavingWithLimit
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND m < 99999 LIMIT 1;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND m < 99999 LIMIT 1;
aggMinWithMultipleHavingOnAliasAndFunction
SELECT gender g, MIN(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND MIN(emp_no) < 99999;
SELECT gender g, MIN(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND MIN(emp_no) < 99999;
// MAX
aggMaxImplicit
SELECT MAX(emp_no) c FROM "emp.emp";
SELECT MAX(emp_no) c FROM "test_emp.emp";
aggMaxImplicitWithCast
SELECT CAST(MAX(emp_no) AS SMALLINT) c FROM "emp.emp";
SELECT CAST(MAX(emp_no) AS SMALLINT) c FROM "test_emp.emp";
aggMax
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY gender ;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY gender ;
aggMaxWithCast
SELECT gender g, CAST(MAX(emp_no) AS SMALLINT) m FROM "emp.emp" GROUP BY gender ;
SELECT gender g, CAST(MAX(emp_no) AS SMALLINT) m FROM "test_emp.emp" GROUP BY gender ;
aggMaxAndCount
SELECT MAX(emp_no) m, COUNT(1) c FROM "emp.emp" GROUP BY gender;
SELECT MAX(emp_no) m, COUNT(1) c FROM "test_emp.emp" GROUP BY gender;
aggMaxAndCountWithFilter
SELECT gender g, MAX(emp_no) m, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender;
SELECT gender g, MAX(emp_no) m, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender;
aggMaxAndCountWithFilterAndLimit
SELECT gender g, MAX(emp_no) m, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
SELECT gender g, MAX(emp_no) m, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
aggMaxWithAlias
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g;
// Conditional MAX
aggMaxWithHaving
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g HAVING MAX(emp_no) > 10;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING MAX(emp_no) > 10;
aggMaxWithHavingOnAlias
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10;
aggMaxWithMultipleHaving
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND m < 99999;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND m < 99999;
aggMaxWithMultipleHavingWithLimit
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND m < 99999 LIMIT 1;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND m < 99999 LIMIT 1;
aggMaxWithMultipleHavingOnAliasAndFunction
SELECT gender g, MAX(emp_no) m FROM "emp.emp" GROUP BY g HAVING m > 10 AND MAX(emp_no) < 99999;
SELECT gender g, MAX(emp_no) m FROM "test_emp.emp" GROUP BY g HAVING m > 10 AND MAX(emp_no) < 99999;
// SUM
aggSumImplicitWithCast
SELECT CAST(SUM(emp_no) AS BIGINT) s FROM "emp.emp";
SELECT CAST(SUM(emp_no) AS BIGINT) s FROM "test_emp.emp";
aggSumWithCast
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s FROM "emp.emp" GROUP BY gender;
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s FROM "test_emp.emp" GROUP BY gender;
aggSumWithCastAndCount
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "emp.emp" GROUP BY gender;
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "test_emp.emp" GROUP BY gender;
aggSumWithCastAndCountWithFilter
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender;
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender;
aggSumWithCastAndCountWithFilterAndLimit
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
aggSumWithAlias
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s FROM "emp.emp" GROUP BY g;
SELECT gender g, CAST(SUM(emp_no) AS BIGINT) s FROM "test_emp.emp" GROUP BY g;
// Conditional SUM
aggSumWithHaving
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY g HAVING SUM(emp_no) > 10;
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY g HAVING SUM(emp_no) > 10;
aggSumWithHavingOnAlias
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY g HAVING s > 10;
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY g HAVING s > 10;
aggSumWithMultipleHaving
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY g HAVING s > 10 AND s < 10000000;
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY g HAVING s > 10 AND s < 10000000;
aggSumWithMultipleHavingWithLimit
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY g HAVING s > 10 AND s < 10000000 LIMIT 1;
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY g HAVING s > 10 AND s < 10000000 LIMIT 1;
aggSumWithMultipleHavingOnAliasAndFunction
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY g HAVING s > 10 AND SUM(emp_no) > 10000000;
SELECT gender g, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY g HAVING s > 10 AND SUM(emp_no) > 10000000;
// AVG
aggAvgImplicitWithCast
SELECT CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp";
SELECT CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp";
aggAvgWithCastToFloat
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY gender;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY gender;
// casting to an exact type - varchar, bigint, etc... will likely fail due to rounding error
aggAvgWithCastToDouble
SELECT gender g, CAST(AVG(emp_no) AS DOUBLE) a FROM "emp.emp" GROUP BY gender;
SELECT gender g, CAST(AVG(emp_no) AS DOUBLE) a FROM "test_emp.emp" GROUP BY gender;
aggAvgWithCastAndCount
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "emp.emp" GROUP BY gender;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "test_emp.emp" GROUP BY gender;
aggAvgWithCastAndCountWithFilter
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender ;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender ;
aggAvgWithCastAndCountWithFilterAndLimit
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a, COUNT(1) c FROM "test_emp.emp" WHERE emp_no > 10000 GROUP BY gender LIMIT 1;
aggAvgWithAlias
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g;
// Conditional AVG
aggAvgWithHaving
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g HAVING AVG(emp_no) > 10;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g HAVING AVG(emp_no) > 10;
aggAvgWithHavingOnAlias
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g HAVING a > 10;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g HAVING a > 10;
aggAvgWithMultipleHaving
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g HAVING a > 10 AND a < 10000000;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g HAVING a > 10 AND a < 10000000;
aggAvgWithMultipleHavingWithLimit
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g HAVING a > 10 AND a < 10000000 LIMIT 1;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g HAVING a > 10 AND a < 10000000 LIMIT 1;
aggAvgWithMultipleHavingOnAliasAndFunction
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "emp.emp" GROUP BY g HAVING a > 10 AND AVG(emp_no) > 10000000;
SELECT gender g, CAST(AVG(emp_no) AS FLOAT) a FROM "test_emp.emp" GROUP BY g HAVING a > 10 AND AVG(emp_no) > 10000000;

View File

@ -6,11 +6,11 @@
// Time
//
dateTimeSecond
SELECT SECOND(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT SECOND(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeMinute
SELECT MINUTE(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT MINUTE(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeHour
SELECT HOUR(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT HOUR(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
//
@ -18,17 +18,17 @@ SELECT HOUR(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER
//
dateTimeDay
SELECT DAY(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT DAY(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeDayOfMonth
SELECT DAY_OF_MONTH(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT DAY_OF_MONTH(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
// dateTimeDayOfWeek - disable since it starts at 0 not 1
// SELECT DAY_OF_WEEK(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
// SELECT DAY_OF_WEEK(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeDayOfYear
SELECT DAY_OF_YEAR(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT DAY_OF_YEAR(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeMonth
SELECT MONTH(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT MONTH(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
dateTimeYear
SELECT YEAR(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT YEAR(birth_date) d, last_name l FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
// NOCOMMIT figure out a way to test the aliases that are unsupported by h2 but are supported by us because they are like PostgreSQL
@ -37,19 +37,19 @@ SELECT YEAR(birth_date) d, last_name l FROM "emp.emp" WHERE emp_no < 10010 ORDER
// Filter
//
dateTimeFilterDayOfMonth
SELECT DAY_OF_MONTH(birth_date) AS d, last_name l FROM "emp.emp" WHERE DAY_OF_MONTH(birth_date) <= 10 ORDER BY emp_no LIMIT 5;
SELECT DAY_OF_MONTH(birth_date) AS d, last_name l FROM "test_emp.emp" WHERE DAY_OF_MONTH(birth_date) <= 10 ORDER BY emp_no LIMIT 5;
dateTimeFilterMonth
SELECT MONTH(birth_date) AS d, last_name l FROM "emp.emp" WHERE MONTH(birth_date) <= 5 ORDER BY emp_no LIMIT 5;
SELECT MONTH(birth_date) AS d, last_name l FROM "test_emp.emp" WHERE MONTH(birth_date) <= 5 ORDER BY emp_no LIMIT 5;
dateTimeFilterYear
SELECT YEAR(birth_date) AS d, last_name l FROM "emp.emp" WHERE YEAR(birth_date) <= 1960 ORDER BY emp_no LIMIT 5;
SELECT YEAR(birth_date) AS d, last_name l FROM "test_emp.emp" WHERE YEAR(birth_date) <= 1960 ORDER BY emp_no LIMIT 5;
//
// Aggregate
//
dateTimeAggByYear
SELECT YEAR(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY YEAR(birth_date) ORDER BY YEAR(birth_date) LIMIT 5;
SELECT YEAR(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY YEAR(birth_date) ORDER BY YEAR(birth_date) LIMIT 5;
// NOCOMMIT Elasticsearch doesn't line up
// dateTimeAggByMonth
// SELECT MONTH(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY MONTH(birth_date) ORDER BY MONTH(birth_date) LIMIT 5;
// SELECT MONTH(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY MONTH(birth_date) ORDER BY MONTH(birth_date) LIMIT 5;
// dateTimeAggByDayOfMonth
// SELECT DAY_OF_MONTH(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "emp.emp" GROUP BY DAY_OF_MONTH(birth_date) ORDER BY DAY_OF_MONTH(birth_date) DESC;
// SELECT DAY_OF_MONTH(birth_date) AS d, CAST(SUM(emp_no) AS INT) s FROM "test_emp.emp" GROUP BY DAY_OF_MONTH(birth_date) ORDER BY DAY_OF_MONTH(birth_date) DESC;

View File

@ -3,18 +3,18 @@
//
whereFieldQuality
SELECT last_name l FROM "emp.emp" WHERE emp_no = 10000 LIMIT 5;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no = 10000 LIMIT 5;
whereFieldLessThan
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 ORDER BY emp_no LIMIT 5;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 ORDER BY emp_no LIMIT 5;
whereFieldAndComparison
SELECT last_name l FROM "emp.emp" WHERE emp_no > 10000 AND emp_no < 10005 ORDER BY emp_no LIMIT 5;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no > 10000 AND emp_no < 10005 ORDER BY emp_no LIMIT 5;
whereFieldOrComparison
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 OR emp_no = 10005 ORDER BY emp_no LIMIT 5;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 OR emp_no = 10005 ORDER BY emp_no LIMIT 5;
whereFieldWithOrder
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 ORDER BY emp_no;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 ORDER BY emp_no;
whereFieldWithExactMatchOnString
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 AND gender = 'M';
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 AND gender = 'M';
whereFieldWithLikeMatch
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 AND last_name LIKE 'K%';
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 AND last_name LIKE 'K%';
whereFieldOnMatchWithAndAndOr
SELECT last_name l FROM "emp.emp" WHERE emp_no < 10003 AND (gender = 'M' AND NOT FALSE OR last_name LIKE 'K%') ORDER BY emp_no;
SELECT last_name l FROM "test_emp.emp" WHERE emp_no < 10003 AND (gender = 'M' AND NOT FALSE OR last_name LIKE 'K%') ORDER BY emp_no;

View File

@ -3,73 +3,73 @@
//
mathAbs
SELECT ABS(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT ABS(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathACos
SELECT ACOS(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT ACOS(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathASin
SELECT ASIN(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT ASIN(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathATan
SELECT ATAN(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT ATAN(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
//mathCbrt
//SELECT CBRT(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
//SELECT CBRT(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathCeil
SELECT CEIL(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT CEIL(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathCos
SELECT COS(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT COS(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathCosh
SELECT COSH(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT COSH(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathDegrees
SELECT DEGREES(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT DEGREES(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathFloor
SELECT CAST(FLOOR(emp_no) AS INT) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT CAST(FLOOR(emp_no) AS INT) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathLog
SELECT LOG(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT LOG(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathLog10
SELECT LOG10(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT LOG10(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathRadians
SELECT RADIANS(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT RADIANS(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathRound
SELECT CAST(ROUND(emp_no) AS INT) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT CAST(ROUND(emp_no) AS INT) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathSin
SELECT SIN(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT SIN(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathSinH
SELECT SINH(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT SINH(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathSqrt
SELECT SQRT(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT SQRT(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathTan
SELECT TAN(emp_no) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT TAN(emp_no) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
//
// Combined methods
//
mathAbsOfSin
SELECT ABS(SIN(emp_no)) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT ABS(SIN(emp_no)) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathAbsOfCeilOfSin
SELECT EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) m, first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
SELECT EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) m, first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
mathAbsOfCeilOfSinWithFilter
SELECT EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) m, first_name FROM "emp.emp" WHERE EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) < 10 ORDER BY emp_no;
SELECT EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) m, first_name FROM "test_emp.emp" WHERE EXP(ABS(CEIL(SIN(DEGREES(emp_no))))) < 10 ORDER BY emp_no;
//
// Filter by Scalar
//
mathAbsFilterAndOrder
SELECT emp_no, ABS(emp_no) m, first_name FROM "emp.emp" WHERE ABS(emp_no) < 10010 ORDER BY ABS(emp_no);
SELECT emp_no, ABS(emp_no) m, first_name FROM "test_emp.emp" WHERE ABS(emp_no) < 10010 ORDER BY ABS(emp_no);
mathACosFilterAndOrder
SELECT emp_no, ACOS(emp_no) m, first_name FROM "emp.emp" WHERE ACOS(emp_no) < 10010 ORDER BY ACOS(emp_no);
SELECT emp_no, ACOS(emp_no) m, first_name FROM "test_emp.emp" WHERE ACOS(emp_no) < 10010 ORDER BY ACOS(emp_no);
mathASinFilterAndOrder
SELECT emp_no, ASIN(emp_no) m, first_name FROM "emp.emp" WHERE ASIN(emp_no) < 10010 ORDER BY ASIN(emp_no);
SELECT emp_no, ASIN(emp_no) m, first_name FROM "test_emp.emp" WHERE ASIN(emp_no) < 10010 ORDER BY ASIN(emp_no);
//mathATanFilterAndOrder
//SELECT emp_no, ATAN(emp_no) m, first_name FROM "emp.emp" WHERE ATAN(emp_no) < 10010 ORDER BY ATAN(emp_no);
//SELECT emp_no, ATAN(emp_no) m, first_name FROM "test_emp.emp" WHERE ATAN(emp_no) < 10010 ORDER BY ATAN(emp_no);
mathCeilFilterAndOrder
SELECT emp_no, CEIL(emp_no) m, first_name FROM "emp.emp" WHERE CEIL(emp_no) < 10010 ORDER BY CEIL(emp_no);
SELECT emp_no, CEIL(emp_no) m, first_name FROM "test_emp.emp" WHERE CEIL(emp_no) < 10010 ORDER BY CEIL(emp_no);
//mathCosFilterAndOrder
//SELECT emp_no, COS(emp_no) m, first_name FROM "emp.emp" WHERE COS(emp_no) < 10010 ORDER BY COS(emp_no);
//SELECT emp_no, COS(emp_no) m, first_name FROM "test_emp.emp" WHERE COS(emp_no) < 10010 ORDER BY COS(emp_no);
//mathCoshFilterAndOrder
//SELECT emp_no, COSH(emp_no) m, first_name FROM "emp.emp" WHERE COSH(emp_no) < 10010 ORDER BY COSH(emp_no);
//SELECT emp_no, COSH(emp_no) m, first_name FROM "test_emp.emp" WHERE COSH(emp_no) < 10010 ORDER BY COSH(emp_no);
//
// constants - added when folding will be supported
//
//mathConstantPI
//SELECT ABS(emp_no) m, PI(), first_name FROM "emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;
//SELECT ABS(emp_no) m, PI(), first_name FROM "test_emp.emp" WHERE emp_no < 10010 ORDER BY emp_no;

View File

@ -3,36 +3,36 @@
//
wildcardWithOrder
SELECT * FROM "emp.emp" ORDER BY emp_no;
SELECT * FROM "test_emp.emp" ORDER BY emp_no;
column
SELECT last_name FROM "emp.emp" ORDER BY emp_no;
SELECT last_name FROM "test_emp.emp" ORDER BY emp_no;
columnWithAlias
SELECT last_name AS l FROM "emp.emp" ORDER BY emp_no;
SELECT last_name AS l FROM "test_emp.emp" ORDER BY emp_no;
columnWithAliasNoAs
SELECT last_name l FROM "emp.emp" ORDER BY emp_no;
SELECT last_name l FROM "test_emp.emp" ORDER BY emp_no;
multipleColumnsNoAlias
SELECT first_name, last_name FROM "emp.emp" ORDER BY emp_no;
SELECT first_name, last_name FROM "test_emp.emp" ORDER BY emp_no;
multipleColumnWithAliasWithAndWithoutAs
SELECT first_name f, last_name AS l FROM "emp.emp" ORDER BY emp_no;
SELECT first_name f, last_name AS l FROM "test_emp.emp" ORDER BY emp_no;
//
// SELECT with LIMIT
//
wildcardWithLimit
SELECT * FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT * FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
wildcardWithOrderWithLimit
SELECT * FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT * FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
columnWithLimit
SELECT last_name FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT last_name FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
columnWithAliasWithLimit
SELECT last_name AS l FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT last_name AS l FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
columnWithAliasNoAsWithLimit
SELECT last_name l FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT last_name l FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
multipleColumnsNoAliasWithLimit
SELECT first_name, last_name FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT first_name, last_name FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
multipleColumnWithAliasWithAndWithoutAsWithLimit
SELECT first_name f, last_name AS l FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT first_name f, last_name AS l FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
//
@ -41,16 +41,16 @@ SELECT first_name f, last_name AS l FROM "emp.emp" ORDER BY emp_no LIMIT 5;
//castWithLiteralToInt
//SELECT CAST(1 AS INT);
castOnColumnNumberToVarchar
SELECT CAST(emp_no AS VARCHAR) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS VARCHAR) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberToLong
SELECT CAST(emp_no AS BIGINT) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS BIGINT) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberToSmallint
SELECT CAST(emp_no AS SMALLINT) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS SMALLINT) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberWithAliasToInt
SELECT CAST(emp_no AS INT) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS INT) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberToReal
SELECT CAST(emp_no AS REAL) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS REAL) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberToDouble
SELECT CAST(emp_no AS DOUBLE) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS DOUBLE) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;
castOnColumnNumberToBoolean
SELECT CAST(emp_no AS BOOL) AS emp_no_cast FROM "emp.emp" ORDER BY emp_no LIMIT 5;
SELECT CAST(emp_no AS BOOL) AS emp_no_cast FROM "test_emp.emp" ORDER BY emp_no LIMIT 5;