Skip to content

Commit

Permalink
fixed TestIssue798TruncatedError
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Jan 24, 2025
1 parent e4527d2 commit 3713b3e
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 202 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Added environment variable `YDB_EXECUTE_DATA_QUERY_OVER_QUERY_SERVICE` for execute data queries from table service client using query client API
* Added `ydb.WithExecuteDataQueryOverQueryClient(bool)` option for execute data queries from table service client using query client API

## v3.98.0
* Supported pool of encoders, which implement ResetableWriter interface
Expand Down
17 changes: 6 additions & 11 deletions internal/table/config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"os"
"time"

"github.com/jonboulle/clockwork"
Expand Down Expand Up @@ -290,16 +289,12 @@ func (c *Config) DeleteTimeout() time.Duration {
}

func defaults() *Config {
executeDataQueryOverQueryService := os.Getenv("YDB_EXECUTE_DATA_QUERY_OVER_QUERY_SERVICE") != ""

return &Config{
sizeLimit: DefaultSessionPoolSizeLimit,
createSessionTimeout: DefaultSessionPoolCreateSessionTimeout,
deleteTimeout: DefaultSessionPoolDeleteTimeout,
idleThreshold: DefaultSessionPoolIdleThreshold,
clock: clockwork.NewRealClock(),
trace: &trace.Table{},
useQuerySession: executeDataQueryOverQueryService,
executeDataQueryOverQueryService: executeDataQueryOverQueryService,
sizeLimit: DefaultSessionPoolSizeLimit,
createSessionTimeout: DefaultSessionPoolCreateSessionTimeout,
deleteTimeout: DefaultSessionPoolDeleteTimeout,
idleThreshold: DefaultSessionPoolIdleThreshold,
clock: clockwork.NewRealClock(),
trace: &trace.Table{},
}
}
2 changes: 1 addition & 1 deletion internal/table/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func newTableSession(ctx context.Context, cc grpc.ClientConnInterface, config *c
)
s.executor = tableExecutor{
client: s.client,
ignoreTruncated: false,
ignoreTruncated: s.config.IgnoreTruncated(),
}

return s, nil
Expand Down
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ func WithSessionPoolIdleThreshold(idleThreshold time.Duration) Option {

// WithExecuteDataQueryOverQueryClient overrides table.Session.Execute with query service
// execute with materialized result
func WithExecuteDataQueryOverQueryClient() Option {
func WithExecuteDataQueryOverQueryClient(b bool) Option {
return func(ctx context.Context, d *Driver) error {
d.tableOptions = append(d.tableOptions, tableConfig.ExecuteDataQueryOverQueryService(true))
d.tableOptions = append(d.tableOptions, tableConfig.ExecuteDataQueryOverQueryService(b))

return nil
}
Expand Down
Loading

0 comments on commit 3713b3e

Please sign in to comment.