Add Max(timestamp) tests to smoke-test (#2025)

* Add Max(timestamp) tests to smoke-test

run a Max() call on a timestamp field twice, and make sure the results are the same

* chmod +x
This commit is contained in:
reesporte 2022-04-18 15:33:20 -05:00 • committed by GitHub
parent 03df1ba6ad
commit a8c1b93610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,57 @@
fields:
- name: "id"
type: uint
step: 1
distribution: "sequential"
min: 1
max: 200
- name: "segid"
type: "int" # (default IntField)
min: 0
max: 3
distribution: "zipfian"
s: 1.1
v: 5.1
- name: "ts"
type: "timestamp"
min_date: 2006-01-02T15:04:05.001Z # RFC3339Nano
max_date: 2022-01-02T15:04:05.001Z # RFC3339Nano
distribution: "increasing" # only "increasing" is supported right now
min_step_duration: "1ms"
max_step_duration: "200ms"
- name: "lastupdated"
type: "timestamp"
min_date: 2006-01-02T15:04:05.001Z # RFC3339Nano
max_date: 2022-01-02T15:04:05.001Z # RFC3339Nano
distribution: "increasing" # only "increasing" is supported right now
min_step_duration: "1ms"
max_step_duration: "200ms"
- name: "slice"
type: "uint-set" # (default IDArrayField)
min: 0
max: 35000
distribution: "zipfian"
s: 1.1
v: 5.1
min_num: 1
max_num: 50
idk_params:
primary_key_config:
field: "id"
fields:
segid:
- type: "ID"
ts:
- type: "RecordTime"
layout: "2006-01-02T15:04:05Z"
epoch: 1970-01-01T00:00:00.0Z
name: "na"
- type: "Timestamp"
layout: "2006-01-02T15:04:05Z"
epoch: 1970-01-01T00:00:00.0Z
name: "last_update"
granularity: "s"
slice:
- type: "IDArray"
time_quantum: "D"

View file

@ -0,0 +1,25 @@
#!/bin/bash
ifErr() {
RESCODE=$?
if [[ $RESCODE != 0 ]]; then
echo $1
exit $RESCODE
fi
}
/data/datagen_linux_arm64 -s custom --custom-config=./fb-1371-datagen.yaml --pilosa.index=fb1371 --pilosa.batch-size=100 --pilosa.hosts=$1
ifErr "datagenning fb1371"
RES1=$( curl $1/index/fb1371/query -d 'Max(ts)' | jq '.results[0].timestampValue' )
ifErr "getting Max 1"
RES2=$( curl $1/index/fb1371/query -d 'Max(ts)' | jq '.results[0].timestampValue' )
ifErr "getting Max 2"
if [[ $RES1 != $RES2 ]]; then
echo "different Max after two calls"
echo "first: $RES1"
echo "second: $RES2"
exit 1
fi