Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 1ddd574

Browse files
committed
Update test and Exec method
1 parent 11c7f46 commit 1ddd574

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

platform/backend_connectors/hydrolix_backend_connector.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,10 @@ func (p *HydrolixBackendConnector) InstanceName() string {
4848
}
4949

5050
func (p *HydrolixBackendConnector) Exec(ctx context.Context, query string, args ...interface{}) error {
51-
return nil
51+
if len(args) == 0 {
52+
_, err := p.connection.ExecContext(ctx, query)
53+
return err
54+
}
55+
_, err := p.connection.ExecContext(ctx, query, args...)
56+
return err
5257
}

platform/ingest/insert_test.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -480,25 +480,27 @@ func TestHydrolixIngest(t *testing.T) {
480480

481481
expectedStatements: []string{
482482
fmt.Sprintf(`{
483-
"schema": {
483+
"schema": {
484484
"project": "%s",
485485
"name": "test_index",
486486
"time_column": "ingest_time",
487487
"columns": [
488-
{ "name": "new_field", "type": "string" },
489-
{ "name": "ingest_time", "type": "datetime", "default": "NOW" }
490-
],
488+
{ "name": "@timestamp", "type": "DateTime64(3)", "metadata": "DEFAULT now64()" },
489+
{ "name": "attributes_values", "type": "Map(String,String)" },
490+
{ "name": "attributes_metadata", "type": "Map(String,String)" },
491+
{ "name": "new_field", "type": "Nullable(String)", "comment": "quesmaMetadataV1:fieldName=new_field" }
492+
],
491493
"partitioning": {
492-
"strategy": "time",
493-
"field": "ingest_time",
494-
"granularity": "day"
495-
}
494+
"strategy": "time",
495+
"field": "ingest_time",
496+
"granularity": "day"
497+
},
496498
},
497499
"events": [
498-
{
499-
"new_field": "bar"
500-
}
501-
]
500+
{
501+
"new_field": "bar"
502+
}
503+
]
502504
}`, projectName),
503505
},
504506
},

0 commit comments

Comments
 (0)