perf(go): optimize tdengine raw frame queries
This commit is contained in:
@@ -107,7 +107,7 @@ func TestWriterNormalizesPhoneTagAndRefreshesExistingChildTags(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriterChunksOversizedParsedJSON(t *testing.T) {
|
||||
func TestWriterChunksOversizedParsedFields(t *testing.T) {
|
||||
exec := &recordingExec{}
|
||||
writer := NewWriter(exec)
|
||||
env := sampleEnvelope()
|
||||
@@ -120,8 +120,8 @@ func TestWriterChunksOversizedParsedJSON(t *testing.T) {
|
||||
}
|
||||
|
||||
rawInsert := findSQL(exec.calls, "INSERT INTO raw_")
|
||||
if !strings.Contains(rawInsert, `"chunked":true`) || !strings.Contains(rawInsert, `"payload_kind":"parsed_json"`) {
|
||||
t.Fatalf("raw insert should store a parsed_json chunk manifest: %s", rawInsert)
|
||||
if !strings.Contains(rawInsert, `"chunked":true`) || !strings.Contains(rawInsert, `"payload_kind":"parsed_fields"`) {
|
||||
t.Fatalf("raw insert should store a parsed_fields chunk manifest: %s", rawInsert)
|
||||
}
|
||||
if got := countSQL(exec.calls, "USING raw_frame_payload_chunks"); got != 1 {
|
||||
t.Fatalf("chunk child create count = %d", got)
|
||||
@@ -131,7 +131,7 @@ func TestWriterChunksOversizedParsedJSON(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriterLeavesParsedJSONEmptyWhenNoParsedPayload(t *testing.T) {
|
||||
func TestWriterLeavesParsedFieldsEmptyWhenNoParsedPayload(t *testing.T) {
|
||||
exec := &recordingExec{}
|
||||
writer := NewWriter(exec)
|
||||
env := sampleEnvelope()
|
||||
@@ -145,7 +145,7 @@ func TestWriterLeavesParsedJSONEmptyWhenNoParsedPayload(t *testing.T) {
|
||||
|
||||
rawInsert := findSQL(exec.calls, "INSERT INTO raw_")
|
||||
if strings.Contains(rawInsert, "'{}'") || strings.Contains(rawInsert, "'null'") {
|
||||
t.Fatalf("raw insert should not store empty parsed_json payload: %s", rawInsert)
|
||||
t.Fatalf("raw insert should not store empty parsed_fields payload: %s", rawInsert)
|
||||
}
|
||||
if !strings.Contains(rawInsert, "'invalid frame checksum'") {
|
||||
t.Fatalf("raw insert should keep parse error: %s", rawInsert)
|
||||
|
||||
Reference in New Issue
Block a user