|
@@ -525,10 +525,10 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
|
|
|
public void testInvalidCharacterInIndexPattern() {
|
|
|
Map<String, String> commands = new HashMap<>();
|
|
|
- commands.put("FROM {}", "line 1:7: ");
|
|
|
+ commands.put("FROM {}", "line 1:6: ");
|
|
|
if (Build.current().isSnapshot()) {
|
|
|
- commands.put("METRICS {}", "line 1:10: ");
|
|
|
- commands.put("ROW x = 1 | LOOKUP_🐔 {} ON j", "line 1:23: ");
|
|
|
+ commands.put("METRICS {}", "line 1:9: ");
|
|
|
+ commands.put("ROW x = 1 | LOOKUP_🐔 {} ON j", "line 1:22: ");
|
|
|
}
|
|
|
String lineNumber;
|
|
|
for (String command : commands.keySet()) {
|
|
@@ -572,7 +572,7 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- lineNumber = command.contains("FROM") ? "line 1:21: " : "line 1:24: ";
|
|
|
+ lineNumber = command.contains("FROM") ? "line 1:20: " : "line 1:23: ";
|
|
|
expectInvalidIndexNameErrorWithLineNumber(command, "indexpattern, --indexpattern", lineNumber, "-indexpattern");
|
|
|
expectInvalidIndexNameErrorWithLineNumber(command, "indexpattern, \"--indexpattern\"", lineNumber, "-indexpattern");
|
|
|
expectInvalidIndexNameErrorWithLineNumber(command, "\"indexpattern, --indexpattern\"", commands.get(command), "-indexpattern");
|
|
@@ -585,7 +585,7 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
if (command.contains("LOOKUP_🐔")) {
|
|
|
continue;
|
|
|
}
|
|
|
- lineNumber = command.contains("FROM") ? "line 1:10: " : "line 1:13: ";
|
|
|
+ lineNumber = command.contains("FROM") ? "line 1:9: " : "line 1:12: ";
|
|
|
clustersAndIndices(command, "*", "-index#pattern");
|
|
|
clustersAndIndices(command, "index*", "-index#pattern");
|
|
|
clustersAndIndices(command, "*", "-<--logstash-{now/M{yyyy.MM}}>");
|
|
@@ -885,18 +885,18 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
public void testDeprecatedIsNullFunction() {
|
|
|
expectError(
|
|
|
"from test | eval x = is_null(f)",
|
|
|
- "line 1:23: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
+ "line 1:22: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
);
|
|
|
expectError(
|
|
|
"row x = is_null(f)",
|
|
|
- "line 1:10: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
+ "line 1:9: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
);
|
|
|
|
|
|
if (Build.current().isSnapshot()) {
|
|
|
expectError(
|
|
|
"from test | eval x = ?fn1(f)",
|
|
|
List.of(paramAsIdentifier("fn1", "IS_NULL")),
|
|
|
- "line 1:23: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
+ "line 1:22: is_null function is not supported anymore, please use 'is null'/'is not null' predicates instead"
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -911,23 +911,23 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
}
|
|
|
|
|
|
public void testMetadataFieldMultipleDeclarations() {
|
|
|
- expectError("from test metadata _index, _version, _index", "1:39: metadata field [_index] already declared [@1:20]");
|
|
|
+ expectError("from test metadata _index, _version, _index", "1:38: metadata field [_index] already declared [@1:20]");
|
|
|
}
|
|
|
|
|
|
public void testMetadataFieldUnsupportedPrimitiveType() {
|
|
|
- expectError("from test metadata _tier", "line 1:21: unsupported metadata field [_tier]");
|
|
|
+ expectError("from test metadata _tier", "line 1:20: unsupported metadata field [_tier]");
|
|
|
}
|
|
|
|
|
|
public void testMetadataFieldUnsupportedCustomType() {
|
|
|
- expectError("from test metadata _feature", "line 1:21: unsupported metadata field [_feature]");
|
|
|
+ expectError("from test metadata _feature", "line 1:20: unsupported metadata field [_feature]");
|
|
|
}
|
|
|
|
|
|
public void testMetadataFieldNotFoundNonExistent() {
|
|
|
- expectError("from test metadata _doesnot_compute", "line 1:21: unsupported metadata field [_doesnot_compute]");
|
|
|
+ expectError("from test metadata _doesnot_compute", "line 1:20: unsupported metadata field [_doesnot_compute]");
|
|
|
}
|
|
|
|
|
|
public void testMetadataFieldNotFoundNormalField() {
|
|
|
- expectError("from test metadata emp_no", "line 1:21: unsupported metadata field [emp_no]");
|
|
|
+ expectError("from test metadata emp_no", "line 1:20: unsupported metadata field [emp_no]");
|
|
|
}
|
|
|
|
|
|
public void testDissectPattern() {
|
|
@@ -985,13 +985,13 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
|
|
|
expectError(
|
|
|
"row a = \"foo bar\" | GROK a \"%{NUMBER:foo} %{WORD:foo}\"",
|
|
|
- "line 1:22: Invalid GROK pattern [%{NUMBER:foo} %{WORD:foo}]:"
|
|
|
+ "line 1:21: Invalid GROK pattern [%{NUMBER:foo} %{WORD:foo}]:"
|
|
|
+ " the attribute [foo] is defined multiple times with different types"
|
|
|
);
|
|
|
|
|
|
expectError(
|
|
|
"row a = \"foo\" | GROK a \"(?P<justification>.+)\"",
|
|
|
- "line 1:18: Invalid grok pattern [(?P<justification>.+)]: [undefined group option]"
|
|
|
+ "line 1:17: Invalid grok pattern [(?P<justification>.+)]: [undefined group option]"
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -1015,7 +1015,7 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
|
|
|
expectError(
|
|
|
"from a | where foo like \"(?i)(^|[^a-zA-Z0-9_-])nmap($|\\\\.)\"",
|
|
|
- "line 1:17: Invalid pattern for LIKE [(?i)(^|[^a-zA-Z0-9_-])nmap($|\\.)]: "
|
|
|
+ "line 1:16: Invalid pattern for LIKE [(?i)(^|[^a-zA-Z0-9_-])nmap($|\\.)]: "
|
|
|
+ "[Invalid sequence - escape character is not followed by special wildcard char]"
|
|
|
);
|
|
|
}
|
|
@@ -1076,7 +1076,7 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
);
|
|
|
expectError(
|
|
|
"from a | enrich typo:countries on foo",
|
|
|
- "line 1:18: Unrecognized value [typo], ENRICH policy qualifier needs to be one of [_ANY, _COORDINATOR, _REMOTE]"
|
|
|
+ "line 1:17: Unrecognized value [typo], ENRICH policy qualifier needs to be one of [_ANY, _COORDINATOR, _REMOTE]"
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -1261,8 +1261,8 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
expectError(
|
|
|
"from test | where x < ?0 and y < ?2",
|
|
|
List.of(paramAsConstant(null, 5)),
|
|
|
- "line 1:24: No parameter is defined for position 0, did you mean position 1?; "
|
|
|
- + "line 1:35: No parameter is defined for position 2, did you mean position 1?"
|
|
|
+ "line 1:23: No parameter is defined for position 0, did you mean position 1?; "
|
|
|
+ + "line 1:34: No parameter is defined for position 2, did you mean position 1?"
|
|
|
);
|
|
|
|
|
|
expectError(
|
|
@@ -2107,11 +2107,11 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
}
|
|
|
|
|
|
public void testInlineConvertWithNonexistentType() {
|
|
|
- expectError("ROW 1::doesnotexist", "line 1:9: Unknown data type named [doesnotexist]");
|
|
|
- expectError("ROW \"1\"::doesnotexist", "line 1:11: Unknown data type named [doesnotexist]");
|
|
|
- expectError("ROW false::doesnotexist", "line 1:13: Unknown data type named [doesnotexist]");
|
|
|
- expectError("ROW abs(1)::doesnotexist", "line 1:14: Unknown data type named [doesnotexist]");
|
|
|
- expectError("ROW (1+2)::doesnotexist", "line 1:13: Unknown data type named [doesnotexist]");
|
|
|
+ expectError("ROW 1::doesnotexist", "line 1:8: Unknown data type named [doesnotexist]");
|
|
|
+ expectError("ROW \"1\"::doesnotexist", "line 1:10: Unknown data type named [doesnotexist]");
|
|
|
+ expectError("ROW false::doesnotexist", "line 1:12: Unknown data type named [doesnotexist]");
|
|
|
+ expectError("ROW abs(1)::doesnotexist", "line 1:13: Unknown data type named [doesnotexist]");
|
|
|
+ expectError("ROW (1+2)::doesnotexist", "line 1:12: Unknown data type named [doesnotexist]");
|
|
|
}
|
|
|
|
|
|
public void testLookup() {
|
|
@@ -2131,7 +2131,7 @@ public class StatementParserTests extends AbstractStatementParserTests {
|
|
|
}
|
|
|
|
|
|
public void testInlineConvertUnsupportedType() {
|
|
|
- expectError("ROW 3::BYTE", "line 1:6: Unsupported conversion to type [BYTE]");
|
|
|
+ expectError("ROW 3::BYTE", "line 1:5: Unsupported conversion to type [BYTE]");
|
|
|
}
|
|
|
|
|
|
public void testMetricsWithoutStats() {
|