Skip to content

Commit 233cc7c

Browse files
committed
Revert "Add enforceEmbeddedSchemaCorrectness to TExecuteStatementReq (#344)"
This reverts commit 3f115aa.
1 parent 3f115aa commit 233cc7c

5 files changed

Lines changed: 12 additions & 81 deletions

File tree

connection.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,6 @@ func (c *conn) executeStatement(ctx context.Context, query string, args []driver
515515
req.Parameters = parameters
516516
}
517517

518-
req.EnforceEmbeddedSchemaCorrectness = c.cfg.EnforceEmbeddedSchemaCorrectness
519-
520518
// Add per-statement query tags if provided via context
521519
if queryTags := driverctx.QueryTagsFromContext(ctx); len(queryTags) > 0 {
522520
serialized := SerializeQueryTags(queryTags)

connector.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,6 @@ func WithEnableMetricViewMetadata(enable bool) ConnOption {
329329
}
330330
}
331331

332-
// WithEnforceEmbeddedSchemaCorrectness enables enforcement of embedded schema correctness
333-
// in query execution. When set to true, the server will enforce embedded schema correctness.
334-
// Default is false.
335-
func WithEnforceEmbeddedSchemaCorrectness(enforce bool) ConnOption {
336-
return func(c *config.Config) {
337-
c.EnforceEmbeddedSchemaCorrectness = enforce
338-
}
339-
}
340-
341332
// Setup of Oauth M2m authentication
342333
func WithClientCredentials(clientID, clientSecret string) ConnOption {
343334
return func(c *config.Config) {

internal/cli_service/cli_service.go

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

internal/cli_service/thrift_field_id_test.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ import (
2020
func TestThriftFieldIdsAreWithinAllowedRange(t *testing.T) {
2121
const maxAllowedFieldID = 3329
2222

23-
allowedExceptions := map[int]bool{
24-
3353: true,
25-
}
26-
2723
// Get the directory of this test file
2824
_, filename, _, ok := runtime.Caller(0)
2925
if !ok {
@@ -34,7 +30,7 @@ func TestThriftFieldIdsAreWithinAllowedRange(t *testing.T) {
3430
testDir := filepath.Dir(filename)
3531
cliServicePath := filepath.Join(testDir, "cli_service.go")
3632

37-
violations, err := validateThriftFieldIDs(cliServicePath, maxAllowedFieldID, allowedExceptions)
33+
violations, err := validateThriftFieldIDs(cliServicePath, maxAllowedFieldID)
3834
if err != nil {
3935
t.Fatalf("Failed to validate thrift field IDs: %v", err)
4036
}
@@ -55,9 +51,8 @@ func TestThriftFieldIdsAreWithinAllowedRange(t *testing.T) {
5551
}
5652

5753
// validateThriftFieldIDs parses the cli_service.go file and extracts all thrift field IDs
58-
// to validate they are within the allowed range. Field IDs listed in allowedExceptions
59-
// are permitted even if they exceed the maximum.
60-
func validateThriftFieldIDs(filePath string, maxAllowedFieldID int, allowedExceptions map[int]bool) ([]string, error) {
54+
// to validate they are within the allowed range.
55+
func validateThriftFieldIDs(filePath string, maxAllowedFieldID int) ([]string, error) {
6156
file, err := os.Open(filePath) //nolint:gosec // G304: path is a test fixture, not user-controlled
6257
if err != nil {
6358
return nil, fmt.Errorf("failed to open file %s: %w", filePath, err)
@@ -89,7 +84,7 @@ func validateThriftFieldIDs(filePath string, maxAllowedFieldID int, allowedExcep
8984
continue
9085
}
9186

92-
if fieldID >= maxAllowedFieldID && !allowedExceptions[fieldID] {
87+
if fieldID >= maxAllowedFieldID {
9388
// Extract struct/field context from the line
9489
context := extractFieldContext(line)
9590
violation := fmt.Sprintf(

internal/config/config.go

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ type UserConfig struct {
101101
// Telemetry configuration
102102
// Uses config overlay pattern: client > server > default.
103103
// Unset = check server feature flag; explicitly true/false overrides the server.
104-
EnableTelemetry ConfigValue[bool]
105-
TelemetryBatchSize int // 0 = use default (100)
106-
TelemetryFlushInterval time.Duration // 0 = use default (5s)
107-
TelemetryRetryCount int // -1 = use default (3); 0 = disable retries; set via telemetry_retry_count
108-
TelemetryRetryDelay time.Duration // 0 = use default (100ms); set via telemetry_retry_delay
109-
Transport http.RoundTripper
110-
UseLz4Compression bool
111-
EnableMetricViewMetadata bool
112-
EnforceEmbeddedSchemaCorrectness bool
104+
EnableTelemetry ConfigValue[bool]
105+
TelemetryBatchSize int // 0 = use default (100)
106+
TelemetryFlushInterval time.Duration // 0 = use default (5s)
107+
TelemetryRetryCount int // -1 = use default (3); 0 = disable retries; set via telemetry_retry_count
108+
TelemetryRetryDelay time.Duration // 0 = use default (100ms); set via telemetry_retry_delay
109+
Transport http.RoundTripper
110+
UseLz4Compression bool
111+
EnableMetricViewMetadata bool
113112
CloudFetchConfig
114113
}
115114

@@ -303,13 +302,6 @@ func ParseDSN(dsn string) (UserConfig, error) {
303302
ucfg.EnableMetricViewMetadata = enableMetricViewMetadata
304303
}
305304

306-
if enforceEmbeddedSchemaCorrectness, ok, err := params.extractAsBool("enforceEmbeddedSchemaCorrectness"); ok {
307-
if err != nil {
308-
return UserConfig{}, err
309-
}
310-
ucfg.EnforceEmbeddedSchemaCorrectness = enforceEmbeddedSchemaCorrectness
311-
}
312-
313305
// Telemetry parameters
314306
if enableTelemetry, ok, err := params.extractAsBool("enableTelemetry"); ok {
315307
if err != nil {

0 commit comments

Comments
 (0)