|
| 1 | +setup: |
| 2 | + - do: |
| 3 | + query.settings: |
| 4 | + body: |
| 5 | + transient: |
| 6 | + plugins.calcite.enabled : true |
| 7 | + |
| 8 | + - do: |
| 9 | + indices.create: |
| 10 | + index: accounts |
| 11 | + body: |
| 12 | + settings: |
| 13 | + number_of_shards: 1 |
| 14 | + number_of_replicas: 0 |
| 15 | + mappings: |
| 16 | + properties: |
| 17 | + email: |
| 18 | + type: text |
| 19 | + |
| 20 | +--- |
| 21 | +teardown: |
| 22 | + - do: |
| 23 | + query.settings: |
| 24 | + body: |
| 25 | + transient: |
| 26 | + plugins.calcite.enabled : false |
| 27 | + |
| 28 | +--- |
| 29 | +"Enhanced error handling for underscores in rex regex capture group names": |
| 30 | + - skip: |
| 31 | + features: |
| 32 | + - headers |
| 33 | + - allowed_warnings |
| 34 | + - do: |
| 35 | + bulk: |
| 36 | + index: accounts |
| 37 | + refresh: true |
| 38 | + body: |
| 39 | + - '{"index": {}}' |
| 40 | + - '{"email": "john@example.com"}' |
| 41 | + |
| 42 | + - do: |
| 43 | + catch: bad_request |
| 44 | + headers: |
| 45 | + Content-Type: 'application/json' |
| 46 | + ppl: |
| 47 | + body: |
| 48 | + query: source=accounts | rex field=email ".+@(?<domain_name>.+)" | fields email, domain_name |
| 49 | + |
| 50 | + - match: { $body: "{\n \"error\": {\n \"reason\": \"Invalid Query\",\n \"details\": \"Underscores are not permitted in Java Regex capture group names\",\n \"type\": \"IllegalArgumentException\"\n },\n \"status\": 400\n}" } |
| 51 | + |
| 52 | +--- |
| 53 | +"Enhanced error handling for underscores in parse regex capture group names": |
| 54 | + - skip: |
| 55 | + features: |
| 56 | + - headers |
| 57 | + - allowed_warnings |
| 58 | + - do: |
| 59 | + bulk: |
| 60 | + index: accounts |
| 61 | + refresh: true |
| 62 | + body: |
| 63 | + - '{"index": {}}' |
| 64 | + - '{"email": "john@example.com"}' |
| 65 | + |
| 66 | + - do: |
| 67 | + catch: bad_request |
| 68 | + headers: |
| 69 | + Content-Type: 'application/json' |
| 70 | + ppl: |
| 71 | + body: |
| 72 | + query: source=accounts | parse email ".+@(?<host_name>.+)" | fields email, host_name |
| 73 | + |
| 74 | + - match: { $body: "{\n \"error\": {\n \"reason\": \"Invalid Query\",\n \"details\": \"Underscores are not permitted in Java Regex capture group names\",\n \"type\": \"IllegalArgumentException\"\n },\n \"status\": 400\n}" } |
| 75 | + |
| 76 | +--- |
| 77 | +"Rex command should work with valid group names without underscores": |
| 78 | + - skip: |
| 79 | + features: |
| 80 | + - headers |
| 81 | + - allowed_warnings |
| 82 | + - do: |
| 83 | + bulk: |
| 84 | + index: accounts |
| 85 | + refresh: true |
| 86 | + body: |
| 87 | + - '{"index": {}}' |
| 88 | + - '{"email": "john@example.com"}' |
| 89 | + |
| 90 | + - do: |
| 91 | + headers: |
| 92 | + Content-Type: 'application/json' |
| 93 | + ppl: |
| 94 | + body: |
| 95 | + query: source=accounts | rex field=email ".+@(?<domain>.+)" | fields email, domain |
| 96 | + |
| 97 | + - match: { total: 1 } |
| 98 | + - match: { datarows: [["john@example.com", "example.com"]] } |
| 99 | + |
| 100 | +--- |
| 101 | +"Parse command should work with valid group names without underscores": |
| 102 | + - skip: |
| 103 | + features: |
| 104 | + - headers |
| 105 | + - allowed_warnings |
| 106 | + - do: |
| 107 | + bulk: |
| 108 | + index: accounts |
| 109 | + refresh: true |
| 110 | + body: |
| 111 | + - '{"index": {}}' |
| 112 | + - '{"email": "john@example.com"}' |
| 113 | + |
| 114 | + - do: |
| 115 | + headers: |
| 116 | + Content-Type: 'application/json' |
| 117 | + ppl: |
| 118 | + body: |
| 119 | + query: source=accounts | parse email ".+@(?<host>.+)" | fields email, host |
| 120 | + |
| 121 | + - match: { total: 1 } |
| 122 | + - match: { datarows: [["john@example.com", "example.com"]] } |
0 commit comments