-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix operation tracing when encoder is included (#261)
Signed-off-by: Pradithya Aria <[email protected]>
- Loading branch information
aria
authored
Jun 17, 2022
1 parent
da829b9
commit b5d7288
Showing
4 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
transformerConfig: | ||
preprocess: | ||
inputs: | ||
- variables: | ||
- name: customer_id | ||
jsonPathConfig: | ||
jsonPath: $.customer.id | ||
- tables: | ||
- name: driver_table | ||
baseTable: | ||
fromJson: | ||
jsonPath: $.drivers[*] | ||
addRowNumber: true | ||
- encoders: | ||
- name: vehicle_mapping | ||
ordinalEncoderConfig: | ||
defaultValue: '0' | ||
targetValueType: INT | ||
mapping: | ||
mpv: '3' | ||
sedan: '2' | ||
suv: '1' | ||
transformations: | ||
- tableTransformation: | ||
inputTable: driver_table | ||
outputTable: transformed_driver_table | ||
steps: | ||
- dropColumns: | ||
- id | ||
- sort: | ||
- column: row_number | ||
order: DESC | ||
- renameColumns: | ||
row_number: rank | ||
- updateColumns: | ||
- column: customer_id | ||
expression: customer_id | ||
- scaleColumns: | ||
- column: rank | ||
standardScalerConfig: | ||
mean: 0.5 | ||
std: 0.2 | ||
- scaleColumns: | ||
- column: rating | ||
minMaxScalerConfig: | ||
min: 1 | ||
max: 5 | ||
- encodeColumns: | ||
- columns: | ||
- vehicle | ||
- previous_vehicle | ||
encoder: vehicle_mapping | ||
- selectColumns: | ||
- customer_id | ||
- name | ||
- rank | ||
- rating | ||
- vehicle | ||
- previous_vehicle | ||
outputs: | ||
- jsonOutput: | ||
jsonTemplate: | ||
fields: | ||
- fieldName: instances | ||
fromTable: | ||
tableName: transformed_driver_table | ||
format: SPLIT | ||
fields: [] | ||
postprocess: {} |
30 changes: 30 additions & 0 deletions
30
api/pkg/transformer/pipeline/testdata/valid_table_join.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
transformerConfig: | ||
preprocess: | ||
inputs: | ||
- tables: | ||
- name: driver_table | ||
baseTable: | ||
fromJson: | ||
jsonPath: $.drivers[*] | ||
addRowNumber: true | ||
- tables: | ||
- name: driver_feature_table | ||
baseTable: | ||
fromJson: | ||
jsonPath: $.drivers_features[*] | ||
addRowNumber: true | ||
transformations: | ||
- tableJoin: | ||
leftTable: driver_table | ||
rightTable: driver_feature_table | ||
outputTable: result_table | ||
how: LEFT | ||
onColumns: [id] | ||
outputs: | ||
- jsonOutput: | ||
jsonTemplate: | ||
fields: | ||
- fieldName: instances | ||
fromTable: | ||
tableName: result_table | ||
format: SPLIT |