-
Notifications
You must be signed in to change notification settings - Fork 301
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
chore(warehouse): added warehouse handling for s3 with glue and other improvements #2940
Conversation
2e89fe0
to
e4f25e1
Compare
f09e02d
to
e8d4a4e
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2940 +/- ##
==========================================
+ Coverage 52.77% 53.11% +0.33%
==========================================
Files 334 332 -2
Lines 52216 52313 +97
==========================================
+ Hits 27558 27784 +226
+ Misses 23056 22937 -119
+ Partials 1602 1592 -10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…s/rudder-server into chore.validations-improvements
@@ -115,23 +115,25 @@ func (bq *HandleT) DeleteTable(tableName string) (err error) { | |||
return | |||
} | |||
|
|||
func (bq *HandleT) CreateTable(tableName string, columnMap map[string]string) (err error) { | |||
func (bq *HandleT) CreateTable(tableName string, columnMap map[string]string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While writing the Unit test, we found that suppression is not happening properly.
The error is getting overridden when we createView
if dedup
flag is enabled.
} | ||
|
||
// Handle error in case of single column | ||
if len(columnsInfo) == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to suppress the errors in case of a single column alter since databricks does support ADD COLUMN IF NOT EXISTS
&validationStep{ | ||
ID: 2, | ||
Name: verifyingConnections, | ||
Validator: ct.verifyingConnections, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was too much coupling with steps and validation functions. steps API will return only the steps. Once we get the steps, we call NewValidator
to get the validating function.
@@ -1,13 +0,0 @@ | |||
package validations_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the package does not contain Ginkgo-based tests. Removing it.
return map[string]*validationFunc{ | ||
"validate": { | ||
Path: "/validate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Path
is not being used. Removed it.
@@ -94,12 +97,49 @@ func (*warehouseGRPC) TriggerWHUpload(_ context.Context, request *proto.WHUpload | |||
return res, err | |||
} | |||
|
|||
func (grpc *warehouseGRPC) Validate(_ context.Context, req *proto.WHValidationRequest) (*proto.WHValidationResponse, error) { | |||
handleT := validations.CTHandleT{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The domain model for the validations package should depend on the destination only, not on the internal representation of the destination like whether tunneling is enabled or not.
Moving the logic to the caller itself
…re.validations-improvements
if CheckAndIgnoreColumnAlreadyExistError(err) { | ||
pkgLogger.Infof("RS: Column already exists for destinationID: %s, tableName: %s with query: %v", rs.Warehouse.Destination.ID, tableName, query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to suppress the errors in case of a single column alter since Redshift does support ADD COLUMN IF NOT EXISTS
@@ -1,60 +0,0 @@ | |||
package validations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to validate.go
@@ -1,149 +0,0 @@ | |||
package validations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to validate.go
type objectStorage struct { | ||
destination *backendconfig.DestinationT | ||
} | ||
|
||
type connections struct { | ||
manager manager.WarehouseOperations | ||
destination *backendconfig.DestinationT | ||
} | ||
|
||
type createSchema struct { | ||
manager manager.WarehouseOperations | ||
} | ||
|
||
type createAlterTable struct { | ||
manager manager.WarehouseOperations | ||
table string | ||
} | ||
|
||
type fetchSchema struct { | ||
manager manager.WarehouseOperations | ||
destination *backendconfig.DestinationT | ||
} | ||
|
||
type loadTable struct { | ||
manager manager.WarehouseOperations | ||
destination *backendconfig.DestinationT | ||
table string | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These satisfies the validator interface to validate the particular step.
warehouse/validations/validate.go
Outdated
if err = operations.Setup(warehouse, &mockUploader{ | ||
dest: dest, | ||
}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why we are doing things. Since mockUploader
is usually for helping testing doesn't imply a lot about its functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the complexity of the changes associated with Uploader
interface in #2993, I am thinking of working on it separately.
I renamed it to dummyUploader
for the current use case.
Description
objectStorage
,connections
,createSchema
,createAlterTable
,fetchSchema
,loadTable
to satisfyValidate() error
instead of coupling it with validation steps.Improvements
Design changes
Notion Ticket
Security