|
| 1 | +setup: |
| 2 | + - do: |
| 3 | + query.settings: |
| 4 | + body: |
| 5 | + transient: |
| 6 | + plugins.calcite.enabled : true |
| 7 | + - do: |
| 8 | + indices.create: |
| 9 | + index: test1 |
| 10 | + body: |
| 11 | + mappings: |
| 12 | + properties: |
| 13 | + "timestamp": |
| 14 | + type: date |
| 15 | + "status": |
| 16 | + type: integer |
| 17 | + "client_ip": |
| 18 | + type: ip |
| 19 | + - do: |
| 20 | + indices.create: |
| 21 | + index: test2 |
| 22 | + body: |
| 23 | + mappings: |
| 24 | + properties: |
| 25 | + "client_ip": |
| 26 | + type: ip |
| 27 | + "city": |
| 28 | + type: keyword |
| 29 | + "country": |
| 30 | + type: keyword |
| 31 | + - do: |
| 32 | + bulk: |
| 33 | + index: test1 |
| 34 | + refresh: true |
| 35 | + body: |
| 36 | + - '{"index":{}}' |
| 37 | + - '{"datetime":"2025-01-15T00:30:00Z","status":200,"client_ip":"10.0.0.1"}' |
| 38 | + - '{"index":{}}' |
| 39 | + - '{"datetime":"2025-01-15T02:15:00Z","status":200,"client_ip":"10.0.0.2"}' |
| 40 | + - '{"index":{}}' |
| 41 | + - '{"datetime":"2025-01-15T10:50:00Z","status":200,"client_ip":"10.0.0.11"}' |
| 42 | + - '{"index":{}}' |
| 43 | + - '{"datetime":"2025-01-15T23:45:00Z","status":200,"client_ip":"10.0.0.24"}' |
| 44 | + - do: |
| 45 | + bulk: |
| 46 | + index: test2 |
| 47 | + refresh: true |
| 48 | + body: |
| 49 | + - '{"index":{}}' |
| 50 | + - '{"client_ip": "10.0.0.1","country": "Canada","city": "Toronto"}' |
| 51 | + - '{"index":{}}' |
| 52 | + - '{"client_ip": "10.0.0.24","country": "UK","city": "London"}' |
| 53 | + - '{"index":{}}' |
| 54 | + - '{"client_ip": "10.0.1.1","country": "USA","city": "New York"}' |
| 55 | + - '{"index":{}}' |
| 56 | + - '{"client_ip": "10.0.1.2","country": "USA","city": "Seattle"}' |
| 57 | + |
| 58 | +--- |
| 59 | +teardown: |
| 60 | + - do: |
| 61 | + query.settings: |
| 62 | + body: |
| 63 | + transient: |
| 64 | + plugins.calcite.enabled : false |
| 65 | + |
| 66 | +--- |
| 67 | +"hash join on IP type should work": |
| 68 | + - skip: |
| 69 | + features: |
| 70 | + - headers |
| 71 | + - allowed_warnings |
| 72 | + - do: |
| 73 | + allowed_warnings: |
| 74 | + - 'Loading the fielddata on the _id field is deprecated and will be removed in future versions. If you require sorting or aggregating on this field you should also include the id in the body of your documents, and map this field as a keyword field that has [doc_values] enabled' |
| 75 | + headers: |
| 76 | + Content-Type: 'application/json' |
| 77 | + ppl: |
| 78 | + body: |
| 79 | + query: source=test1 | stats count() as cnt by client_ip | join type=inner client_ip test2 | fields client_ip, cnt |
| 80 | + |
| 81 | + |
| 82 | + - match: { total: 2 } |
| 83 | + - match: {"datarows": [["10.0.0.1", 1], ["10.0.0.24", 1]]} |
0 commit comments