Skip to content

Commit b13e138

Browse files
committed
implement WriteColumn in clickhouse columns
1 parent 68d2acc commit b13e138

File tree

2 files changed

+188
-0
lines changed

2 files changed

+188
-0
lines changed

plugin/output/clickhouse/colgenerator/insane_column.go.tmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ func (t *{{ $type.ColumnTypeName }}) EncodeColumn(buffer *proto.Buffer) {
142142
t.col.EncodeColumn(buffer)
143143
}
144144

145+
func (t *{{ $type.ColumnTypeName }}) WriteColumn(writer *proto.Writer) {
146+
{{- if $type.Nullable }}
147+
if t.nullable {
148+
t.nullCol.WriteColumn(writer)
149+
return
150+
}
151+
{{- end }}
152+
{{- if $type.LowCardinality }}
153+
if t.lc {
154+
t.lcCol.WriteColumn(writer)
155+
return
156+
}
157+
{{- end }}
158+
t.col.WriteColumn(writer)
159+
}
160+
145161
{{ if $type.Preparable }}
146162
// Prepare the column before sending.
147163
func (t *{{ $type.ColumnTypeName }}) Prepare() error {

plugin/output/clickhouse/column_gen.go

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)