-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: extractNormalizedInsertQueryAndColumns
does not remove backticks inside a dot-delimited column name
#1401
Comments
@fidiego thanks for reporting this. Could you (if possible) post an INSERT statement generated by |
sure thing @jkaflik. INSERT SQL
INSERT INTO
`otel_traces` (
`id`,
`created_by_id`,
`created_at`,
`updated_at`,
`deleted_at`,
`runner_id`,
`runner_job_id`,
`runner_job_execution_id`,
`timestamp`,
`timestamp_date`,
`timestamp_time`,
`resource_attributes`,
`resource_schema_url`,
`scope_name`,
`scope_version`,
`scope_attributes`,
`scope_dropped_attr_count`,
`scope_schema_url`,
`trace_id`,
`span_id`,
`parent_span_id`,
`trace_state`,
`span_name`,
`span_kind`,
`service_name`,
`span_attributes`,
`duration`,
`status_code`,
`status_message`,
`events`.`timestamp`,
`events`.`name`,
`events`.`attributes`
)
VALUES
(
'',
'',
'2024-09-09 18:49:12.765',
'2024-09-09 18:49:12.765',
0,
'runccccccccccccccccccccccc',
'',
'',
'2018-12-13 08:51:00',
'0000-00-00 00:00:00',
'0000-00-00 00:00:00',
{ 'job.id' :'jobidentfier',
'service.name': 'runner-runxxxxxxxxxxxxxxxxxxxxxxxxxxx' },
'',
'my.library',
'1.0.0',
{'my.scope.attribute':'some scope attribute'},
0,
'',
'5bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'eee19b7ec3c1b174',
'eee19b7ec3c1b173',
'',
'I''m a server span',
'Server',
'runner-runxxxxxxxxxxxxxxxxxxxxxxxxxxx',
{'my.span.attr':'some value'},
1,
'Unset',
'',
(
'2018-12-13 14:51:01',
'2020-02-11 20:26:13',
'2020-02-11 20:26:13'
),
('ebento1', 'event-with-attr', 'event'),
(
[],
{ 'span-event-attr' :'span-event-attr-val' } ',
[]
)
)
|
hi @jkaflik, following up on this. if it is useful, i can set up a reproduction. |
@fidiego sorry for delayed response. Yes, please. |
@jkaflik no worries. I've set up a PoC here. https://github.com/fidiego/ch-go-poc In my actual code I define a struct for the migration w/ The dot-delimited fields work as |
hi @jkaflik, i hope all is well. i wanted to ask if there was anything you needed from my end or if there were any updates on this issue. |
@fidiego, thanks for submitting a reproduction DDL. I will take a look this week. Apologies, my focus was shift on another project. |
hi @jkaflik and @SpencerTorres, i just wanted to circle back on this. there is no urgency on my end but i am curious as to whether or not this is something that can be addressed in |
Observed
extractNormalizedInsertQueryAndColumns
cleans up leading and trailing backticks in columns such as "events
.attributes
" but leaves the internal backticks untouched leading to ablock cannot be sorted
error due to the mismatch.This affects
Nested
type columns used via go-gorm.Expected behaviour
Ideally,
extractNormalizedInsertQueryAndColumns
should handle this case.Working `extractNormalizedInsertQueryColumns`
`show create traces`
Code example
Error log
Details
Environment
clickhouse-go
version: 2.28.2go-gorm/clickhouse
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: