| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- package bucket
- import (
- "fmt"
- "testing"
- "time"
- . "git.wecise.com/wecise/odbserver/odb"
- "git.wecise.com/wecise/odbserver/odb/test"
- "gitee.com/wecisecode/util/logger"
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- )
- type BucketLogsTests struct {
- Test *testing.T
- g *Gutil
- }
- func BucketLogsTest(t *testing.T) {
- g := test.TestG()
- t.Run("InitG", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.InitG()
- })
- t.Run("Class", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.Class()
- })
- t.Run("Data", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.Data()
- })
- time.Sleep(time.Duration(1) * time.Second)
- t.Run("Valid", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.Valid()
- })
- t.Run("Alter", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.Alter()
- })
- t.Run("Drop", func(t *testing.T) {
- test := &BucketLogsTests{Test: t, g: g}
- test.Drop()
- })
- }
- func (t *BucketLogsTests) InitG() {
- require.NotNil(t.Test, t.g)
- }
- func (t *BucketLogsTests) Class() {
- t.g.Query(`
- create class if not exists /test();
- alter /test/ drop column bklog3;
- `)
- // alter /test/ drop column bklog3 可能报错,忽略该错误
- _, _, err := t.g.Query(`
- create class if not exists /test/bucketlog (
-
- host varchar,
- bklog bucket {
- "type" : "bitlog",
- "files": ["*.log"],
- "sample" : ["2020-05-15 00:49:59,666"],
- "ttl" : 365
- } 'full',
-
- keys(host),
- indexes(host)
-
- ) with key=manu, nickname='bucketlog'
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(`
- create class if not exists /test/bucketlog2 (
-
- host varchar,
- bklog2 bucket {
- "type" : "bitlog",
- "files": ["*.log"],
- "sample" : ["2020-05-15 00:49:59,666"],
- "ttl" : 365
- } 'full',
-
- keys(host),
- indexes(host)
-
- ) with key=manu, nickname='bucketlog2'
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- }
- func (t *BucketLogsTests) Data() {
- var err error
- /*_, _, err = t.g.Query(` insert into /test/bucketlog (id) values ("linux:wecise") `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(` insert into /test/bucketlog2 (id) values ("linux:wecise2") `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- */
- _, _, err = t.g.Query(`
-
- insert into /test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
-
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(`
-
- insert into /test/bucketlog2 (id, bklog2['file1.log']) values ('linux:wecise2', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
-
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(`
-
- insert into /test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-2--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-3--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-4--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables", "1-5--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-6--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-7--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key", "1-8--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key", "1-9--INFO [Thread-3] 2020-07-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields", "1-10--INFO [Thread-8] 2020-07-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
-
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- stat, errr := t.g.Prepare(` insert into /test/bucketlog (id, bklog[?]) values (?, ?) `)
- if errr != nil {
- logger.Errorf("%v", errr)
- }
- require.Nil(t.Test, errr)
- _, _, err = stat.Exec("file1.log", "linux:wecise", []string{"1-1--DEBUG [CompactionExecutor:584] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-2--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-3--DEBUG [CompactionExecutor:584] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-4--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables", "1-5--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-6--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-7--WARN [Native-Transport-Requests-1] 2020-09-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key", "1-8--WARN [Native-Transport-Requests-1] 2020-09-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key", "1-9--INFO [Thread-3] 2020-09-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields", "1-10--INFO [Thread-8] 2020-09-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"})
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = stat.Exec("file1.log", "linux:wecise", `1-1--DEBUG [CompactionExecutor:584] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-11-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-11-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-11-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-11-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields`)
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(`
-
- insert into /test/bucketlog (id, bklog['file1.log','file1.log','file1.log']) values ('linux:wecise', [["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 01:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 01:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-25 01:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-25 01:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 02:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 02:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-25 02:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-25 02:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 03:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 03:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-25 03:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-25 03:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"]])
-
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- _, _, err = t.g.Query(`
-
- insert into /test/bucketlog (id, bklog['file1.log','file1.log','file1.log']) values ('linux:wecise', [["1-1--DEBUG [CompactionExecutor:584] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-26 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-26 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-26 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-26 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-27 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-27 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-27 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-27 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"],["1-1--DEBUG [CompactionExecutor:584] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-2--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-3--DEBUG [CompactionExecutor:584] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-4--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
- 1-5--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-6--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
- 1-7--WARN [Native-Transport-Requests-1] 2020-06-28 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
- 1-8--WARN [Native-Transport-Requests-1] 2020-06-28 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
- 1-9--INFO [Thread-3] 2020-06-28 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
- 1-10--INFO [Thread-8] 2020-06-28 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"]])
-
- `)
- if err != nil {
- logger.Errorf("%v", err)
- }
- require.Nil(t.Test, err, fmt.Sprint(err))
- }
- func (t *BucketLogsTests) Valid() {
- var err error
- _, _, err = t.g.Query(`select bklog FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT bklog.time('2020-04-22', '').inst() FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT bklog.date("2020-06-28").inst() FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT bklog["file*.log"{116669996670004, 116669996680008}] FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT bklog["file1.log"{1,3,6,7}].time('2020-06-25 00:49:59,667', '').find( "twcs skipping" ) FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT bklog.time('2020-06-23 14:50','2020-06-23 15:00').find('twcs'),id FROM /test/bucketlog`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`SELECT id FROM /test/bucketlog where bklog.time("2020-05-01","").find("INFO").assert() `)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`select bklog2 FROM /test/bucketlog2`)
- assert.Nil(t.Test, err)
- }
- func (t *BucketLogsTests) Alter() {
- var err error
- _, _, err = t.g.Query(`alter /test add column bklog3 bucket {
- "type" : "bitlog",
- "files": ["*.log"],
- "sample" : ["2020-05-15 00:49:59,666"],
- "ttl" : 365
- } 'full' `)
- if err != nil {
- fmt.Printf("%v", err)
- }
- assert.Nil(t.Test, err)
- }
- func (t *BucketLogsTests) Drop() {
- var err error
- _, _, err = t.g.Query(`delete bklog2, bklog3 from /test/bucketlog2 `)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`delete from /test/bucketlog2 with version`)
- assert.Nil(t.Test, err)
- _, _, err = t.g.Query(`drop class /test/bucketlog2 `)
- //assert.Nil(t.Test, err)
- }
|