SQL: Disable column type autodetection in CSV tests (elastic/x-pack-elasticsearch#2634)

Related to elastic/x-pack-elasticsearch#2608

Original commit: elastic/x-pack-elasticsearch@d1a45eab15
This commit is contained in:
Igor Motov 2017-09-27 18:19:07 -04:00 committed by GitHub
parent 6bae50a228
commit 5f385d9155
3 changed files with 18 additions and 15 deletions

View File

@ -95,6 +95,9 @@ public abstract class CsvSpecTestCase extends SpecBaseIntegrationTestCase {
String header = bufferedReader.readLine();
if (!header.contains(":")) {
// No type information in headers, no need to parse columns - trigger auto-detection
// TODO: Remove when type autodetection in JDBC CSV is fixed
// See https://sourceforge.net/p/csvjdbc/discussion/56965/thread/6a910831/ for more info
fail("The autodetection of types in JDBC CSV is currently broken. Please specify explicit types");
return new Tuple<>(expectedResults,"");
}
try (StringWriter writer = new StringWriter()) {

View File

@ -5,7 +5,7 @@
singlePercentileWithoutComma
SELECT gender, PERCENTILE(emp_no, 97) p1 FROM test_emp GROUP BY gender;
gender | p1
gender:s | p1:d
M | 10095.6112
F | 10099.1936
;
@ -13,7 +13,7 @@ F | 10099.1936
singlePercentileWithComma
SELECT gender, PERCENTILE(emp_no, 97.76) p1 FROM test_emp GROUP BY gender;
gender | p1
gender:s | p1:d
M | 10095.6112
F | 10099.1936
;
@ -21,7 +21,7 @@ F | 10099.1936
multiplePercentilesOneWithCommaOneWithout
SELECT gender, PERCENTILE(emp_no, 92.45) p1, PERCENTILE(emp_no, 91) p2 FROM test_emp GROUP BY gender;
gender | p1 | p2
gender:s | p1:d | p2:d
M | 10090.319 | 10087.68
F | 10095.128 | 10093.52
;
@ -29,7 +29,7 @@ F | 10095.128 | 10093.52
multiplePercentilesWithoutComma
SELECT gender, PERCENTILE(emp_no, 91) p1, PERCENTILE(emp_no, 89) p2 FROM test_emp GROUP BY gender;
gender | p1 | p2
gender:s | p1:d | p2:d
M | 10087.68 | 10085.18
F | 10093.52 | 10092.08
;
@ -37,7 +37,7 @@ F | 10093.52 | 10092.08
multiplePercentilesWithComma
SELECT gender, PERCENTILE(emp_no, 85.7) p1, PERCENTILE(emp_no, 94.3) p2 FROM test_emp GROUP BY gender;
gender | p1 | p2
gender:s | p1:d | p2:d
M | 10083.134 | 10091.932
F | 10088.852 | 10097.792
;
@ -45,7 +45,7 @@ F | 10088.852 | 10097.792
percentileRank
SELECT gender, PERCENTILE_RANK(emp_no, 10025) rank FROM test_emp GROUP BY gender;
gender | rank
gender:s | rank:d
M | 23.41269841269841
F | 26.351351351351347
;
@ -53,7 +53,7 @@ F | 26.351351351351347
multiplePercentileRanks
SELECT gender, PERCENTILE_RANK(emp_no, 10030.0) rank1, PERCENTILE_RANK(emp_no, 10025) rank2 FROM test_emp GROUP BY gender;
gender | rank1 | rank2
gender:s | rank1:d | rank2:d
M | 29.365079365079367 | 23.41269841269841
F | 29.93762993762994 | 26.351351351351347
;
@ -61,7 +61,7 @@ F | 29.93762993762994 | 26.351351351351347
multiplePercentilesAndPercentileRank
SELECT gender, PERCENTILE(emp_no, 97.76) p1, PERCENTILE(emp_no, 93.3) p2, PERCENTILE_RANK(emp_no, 10025) rank FROM test_emp GROUP BY gender;
gender | p1 | p2 | rank
gender:s | p1:d | p2:d | rank:d
M | 10095.6112 | 10090.846 | 23.41269841269841
F | 10099.1936 | 10096.351999999999 | 26.351351351351347
;

View File

@ -6,7 +6,7 @@
showFunctions
SHOW FUNCTIONS;
name | type
name:s | type:s
AVG |AGGREGATE
COUNT |AGGREGATE
MAX |AGGREGATE
@ -64,7 +64,7 @@ TAN |SCALAR
showFunctionsWithExactMatch
SHOW FUNCTIONS LIKE 'ABS';
name | type
name:s | type:s
ABS |SCALAR
;
@ -72,7 +72,7 @@ ABS |SCALAR
showFunctionsWithPatternWildcard
SHOW FUNCTIONS LIKE 'A%';
name | type
name:s | type:s
AVG |AGGREGATE
ABS |SCALAR
ACOS |SCALAR
@ -83,7 +83,7 @@ ATAN |SCALAR
showFunctionsWithPatternChar
SHOW FUNCTIONS LIKE 'A__';
name | type
name:s | type:s
AVG |AGGREGATE
ABS |SCALAR
;
@ -91,7 +91,7 @@ ABS |SCALAR
showFunctions
SHOW FUNCTIONS '%DAY%';
name | type
name:s | type:s
DAY_OF_MONTH |SCALAR
DAY |SCALAR
DAY_OF_WEEK |SCALAR
@ -103,7 +103,7 @@ MINUTE_OF_DAY |SCALAR
showTables
SHOW TABLES;
table
table:s
test_emp
;
@ -112,7 +112,7 @@ test_emp
describe
DESCRIBE "test_emp";
column | type
column:s | type:s
birth_date |TIMESTAMP
emp_no |INTEGER
first_name |VARCHAR