Skip to content

Commit

Permalink
Logging: extended support (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 authored Nov 25, 2024
1 parent d670387 commit a84f7b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
18 changes: 16 additions & 2 deletions app/server/data_source_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ func (dsc *DataSourceCollection) DescribeTable(
api_common.EDataSourceKind_MYSQL, api_common.EDataSourceKind_GREENPLUM, api_common.EDataSourceKind_ORACLE:
ds, err := dsc.rdbms.Make(logger, kind)
if err != nil {
return nil, err
return nil, fmt.Errorf("make data source: %w", err)
}

return ds.DescribeTable(ctx, logger, request)
case api_common.EDataSourceKind_LOGGING:
ds, err := dsc.rdbms.Make(logger, api_common.EDataSourceKind_YDB)
if err != nil {
return nil, fmt.Errorf("make data source: %w", err)
}

return ds.DescribeTable(ctx, logger, request)
Expand All @@ -65,7 +72,14 @@ func (dsc *DataSourceCollection) DoReadSplit(
api_common.EDataSourceKind_MYSQL, api_common.EDataSourceKind_GREENPLUM, api_common.EDataSourceKind_ORACLE:
ds, err := dsc.rdbms.Make(logger, kind)
if err != nil {
return err
return fmt.Errorf("make data source: %w", err)
}

return readSplit[any](logger, stream, request, split, ds, dsc.memoryAllocator, dsc.readLimiterFactory, dsc.cfg)
case api_common.EDataSourceKind_LOGGING:
ds, err := dsc.rdbms.Make(logger, api_common.EDataSourceKind_YDB)
if err != nil {
return fmt.Errorf("make data source: %w", err)
}

return readSplit[any](logger, stream, request, split, ds, dsc.memoryAllocator, dsc.readLimiterFactory, dsc.cfg)
Expand Down
2 changes: 1 addition & 1 deletion app/server/datasource/rdbms/ydb/schema_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (f *schemaProvider) GetSchema(
desc := options.Description{}
prefix := path.Join(db.Name(), request.Table)

logger.Debug("obtaining table metadata", zap.String("prefix", prefix))
logger.Debug("Obtaining table metadata", zap.String("prefix", prefix))

err := db.Table().Do(
ctx,
Expand Down
4 changes: 2 additions & 2 deletions app/server/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func validateDataSourceOptions(dsi *api_common.TDataSourceInstance) error {
case api_common.EDataSourceKind_GREENPLUM:
return nil
case api_common.EDataSourceKind_CLICKHOUSE, api_common.EDataSourceKind_S3, api_common.EDataSourceKind_YDB,
api_common.EDataSourceKind_MYSQL:
api_common.EDataSourceKind_MYSQL, api_common.EDataSourceKind_LOGGING:
default:
return fmt.Errorf("unsupported data source: %w", common.ErrInvalidRequest)
return fmt.Errorf("unsupported data source %s: %w", dsi.GetKind().String(), common.ErrInvalidRequest)
}

return nil
Expand Down

0 comments on commit a84f7b9

Please sign in to comment.