@@ -101,78 +101,14 @@ describe("task events v2", () => {
101101 }
102102 ) ;
103103
104- clickhouseTest (
105- "computes attributes_text for a writer that omits it" ,
106- async ( { clickhouseContainer } ) => {
107- const ch = new ClickHouse ( { url : clickhouseContainer . getConnectionUrl ( ) , name : "test" } ) ;
108- const spanId = "span_computed_attributes" ;
109-
110- // An older writer that only sends the JSON column still gets attributes_text
111- // from the DEFAULT expression, so both writer generations can coexist.
112- const insert = ch . writer . insertUnsafe < Record < string , unknown > > ( {
113- name : "insertTaskEventsV2WithoutAttributesText" ,
114- table : "trigger_dev.task_events_v2" ,
115- columns : [
116- "environment_id" ,
117- "organization_id" ,
118- "project_id" ,
119- "task_identifier" ,
120- "run_id" ,
121- "start_time" ,
122- "duration" ,
123- "trace_id" ,
124- "span_id" ,
125- "parent_span_id" ,
126- "message" ,
127- "kind" ,
128- "status" ,
129- "attributes" ,
130- "metadata" ,
131- "expires_at" ,
132- ] ,
133- settings : { enable_json_type : 1 } ,
134- } ) ;
135-
136- const [ insertError ] = await insert ( [
137- {
138- ...baseEvent ( spanId ) ,
139- attributes : { z : 1 , a : "hello" } ,
140- } ,
141- ] ) ;
142- expect ( insertError ) . toBeNull ( ) ;
143-
144- const [ readError , rows ] = await readAttributesText ( ch ) ( {
145- environmentId : "env_attributes_text" ,
146- spanId,
147- } ) ;
148- expect ( readError ) . toBeNull ( ) ;
149- expect ( rows ) . toEqual ( [
150- {
151- attributes_text : '{"a":"hello","z":1}' ,
152- attributes_json : '{"a":"hello","z":1}' ,
153- has_inserted_at : 1 ,
154- } ,
155- ] ) ;
156- }
157- ) ;
158-
159- clickhouseTest ( "attributes_text is a DEFAULT column" , async ( { clickhouseContainer } ) => {
104+ clickhouseTest ( "attributes_text is a plain stored column" , async ( { clickhouseContainer } ) => {
160105 const ch = new ClickHouse ( { url : clickhouseContainer . getConnectionUrl ( ) , name : "test" } ) ;
161106
162107 const [ columnError , columns ] = await readColumnKinds ( ch ) ( { } ) ;
163108 expect ( columnError ) . toBeNull ( ) ;
164109 expect ( columns ) . toEqual ( [
165110 { name : "attributes" , default_kind : "" , default_expression : "" } ,
166- {
167- name : "attributes_input" ,
168- default_kind : "EPHEMERAL" ,
169- default_expression : "defaultValueOfTypeName('JSON')" ,
170- } ,
171- {
172- name : "attributes_text" ,
173- default_kind : "DEFAULT" ,
174- default_expression : "toJSONString(attributes)" ,
175- } ,
111+ { name : "attributes_text" , default_kind : "" , default_expression : "" } ,
176112 ] ) ;
177113 } ) ;
178114
0 commit comments