From 4fbf8b403afc7c13a95e502274ada9796325dae0 Mon Sep 17 00:00:00 2001 From: Nikhil Sinha <131262146+nikhilsinhaparseable@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:26:51 -0500 Subject: [PATCH] fix: update data type to Int64 for detect schema (#83) Int64 to Float64 change is applicable for `TestSmokeLoadWithK6Stream` --- model.go | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++ quest_test.go | 2 +- 2 files changed, 192 insertions(+), 1 deletion(-) diff --git a/model.go b/model.go index 7b7caa1..d73dc51 100644 --- a/model.go +++ b/model.go @@ -265,6 +265,197 @@ const FlogJsonSchema string = `{ ], "metadata": {} }` +const DetectSchema_SchemaBody string = `{ + "fields": [ + { + "name": "app_meta", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "device_id", + "data_type": "Int64", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "host", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "level", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "location", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "message", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "os", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "p_metadata", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "p_tags", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "p_timestamp", + "data_type": { + "Timestamp": [ + "Millisecond", + null + ] + }, + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "process_id", + "data_type": "Int64", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "request_body", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "response_time", + "data_type": "Int64", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "runtime", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "session_id", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "source_time", + "data_type": { + "Timestamp": [ + "Millisecond", + null + ] + }, + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "status_code", + "data_type": "Int64", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "timezone", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "user_agent", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "user_id", + "data_type": "Int64", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "uuid", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + }, + { + "name": "version", + "data_type": "Utf8", + "nullable": true, + "dict_id": 0, + "dict_is_ordered": false, + "metadata": {} + } + ], + "metadata": {} +}` const SchemaBody string = `{ "fields": [ diff --git a/quest_test.go b/quest_test.go index aac08f0..709865c 100644 --- a/quest_test.go +++ b/quest_test.go @@ -61,7 +61,7 @@ func TestSmokeCreateStream(t *testing.T) { } func TestSmokeDetectSchema(t *testing.T) { - DetectSchema(t, NewGlob.QueryClient, SampleJson, SchemaBody) + DetectSchema(t, NewGlob.QueryClient, SampleJson, DetectSchema_SchemaBody) } func TestSmokeIngestEventsToStream(t *testing.T) {