Skip to content
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

Logging: more support #215

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading