@@ -83,7 +83,7 @@ class FeatureGroupToBeMerged:
83
83
Attributes:
84
84
features (List[str]): A list of strings representing feature names of this FeatureGroup.
85
85
included_feature_names (List[str]): A list of strings representing features to be
86
- included in the sql join.
86
+ included in the SQL join.
87
87
projected_feature_names (List[str]): A list of strings representing features to be
88
88
included for final projection in output.
89
89
catalog (str): A string representing the catalog.
@@ -96,15 +96,15 @@ class FeatureGroupToBeMerged:
96
96
be used as target join key (default: None).
97
97
table_type (TableType): A TableType representing the type of table if it is Feature Group or
98
98
Panda Data Frame (default: None).
99
- feature_name_in_target (str): A string representing the feature in the target feature
99
+ feature_name_in_target (str): A string representing the feature name in the target feature
100
100
group that will be compared to the target feature in the base feature group.
101
- If None is provided, the record identifier will be used in the
102
- join statement . (default: None).
101
+ If None is provided, the record identifier feature will be used in the
102
+ SQL join . (default: None).
103
103
join_comparator (JoinComparatorEnum): A JoinComparatorEnum representing the comparator
104
104
used when joining the target feature in the base feature group and the feature
105
- in the target feature group (default: None ).
105
+ in the target feature group. (default: JoinComparatorEnum.EQUALS ).
106
106
join_type (JoinTypeEnum): A JoinTypeEnum representing the type of join between
107
- the base and target feature groups. (default: None ).
107
+ the base and target feature groups. (default: JoinTypeEnum.INNER_JOIN ).
108
108
"""
109
109
110
110
features : List [str ] = attr .ib ()
@@ -118,17 +118,17 @@ class FeatureGroupToBeMerged:
118
118
target_feature_name_in_base : str = attr .ib (default = None )
119
119
table_type : TableType = attr .ib (default = None )
120
120
feature_name_in_target : str = attr .ib (default = None )
121
- join_comparator : JoinComparatorEnum = attr .ib (default = None )
122
- join_type : JoinTypeEnum = attr .ib (default = None )
121
+ join_comparator : JoinComparatorEnum = attr .ib (default = JoinComparatorEnum . EQUALS )
122
+ join_type : JoinTypeEnum = attr .ib (default = JoinTypeEnum . INNER_JOIN )
123
123
124
124
125
125
def construct_feature_group_to_be_merged (
126
126
target_feature_group : FeatureGroup ,
127
127
included_feature_names : List [str ],
128
128
target_feature_name_in_base : str = None ,
129
129
feature_name_in_target : str = None ,
130
- join_comparator : JoinComparatorEnum = None ,
131
- join_type : JoinTypeEnum = None ,
130
+ join_comparator : JoinComparatorEnum = JoinComparatorEnum . EQUALS ,
131
+ join_type : JoinTypeEnum = JoinTypeEnum . INNER_JOIN ,
132
132
) -> FeatureGroupToBeMerged :
133
133
"""Construct a FeatureGroupToBeMerged object by provided parameters.
134
134
@@ -138,15 +138,15 @@ def construct_feature_group_to_be_merged(
138
138
included in the output.
139
139
target_feature_name_in_base (str): A string representing the feature name in base which
140
140
will be used as target join key (default: None).
141
- feature_name_in_target (str): A string representing the feature in the target feature
141
+ feature_name_in_target (str): A string representing the feature name in the target feature
142
142
group that will be compared to the target feature in the base feature group.
143
- If None is provided, the record identifier will be used in the
144
- join statement . (default: None).
143
+ If None is provided, the record identifier feature will be used in the
144
+ SQL join . (default: None).
145
145
join_comparator (JoinComparatorEnum): A JoinComparatorEnum representing the comparator
146
146
used when joining the target feature in the base feature group and the feature
147
- in the target feature group (default: None ).
147
+ in the target feature group. (default: JoinComparatorEnum.EQUALS ).
148
148
join_type (JoinTypeEnum): A JoinTypeEnum representing the type of join between
149
- the base and target feature groups. (default: None ).
149
+ the base and target feature groups. (default: JoinTypeEnum.INNER_JOIN ).
150
150
Returns:
151
151
A FeatureGroupToBeMerged object.
152
152
@@ -290,8 +290,8 @@ def with_feature_group(
290
290
target_feature_name_in_base : str = None ,
291
291
included_feature_names : List [str ] = None ,
292
292
feature_name_in_target : str = None ,
293
- join_comparator : JoinComparatorEnum = None ,
294
- join_type : JoinTypeEnum = None ,
293
+ join_comparator : JoinComparatorEnum = JoinComparatorEnum . EQUALS ,
294
+ join_type : JoinTypeEnum = JoinTypeEnum . INNER_JOIN ,
295
295
):
296
296
"""Join FeatureGroup with base.
297
297
@@ -301,15 +301,15 @@ def with_feature_group(
301
301
will be used as a join key (default: None).
302
302
included_feature_names (List[str]): A list of strings representing features to be
303
303
included in the output (default: None).
304
- feature_name_in_target (str): A string representing the feature in the target feature
305
- group that will be compared to the target feature in the base feature group.
306
- If None is provided, the record identifier will be used in the
307
- join statement . (default: None).
304
+ feature_name_in_target (str): A string representing the feature name in the target
305
+ feature group that will be compared to the target feature in the base feature group.
306
+ If None is provided, the record identifier feature will be used in the
307
+ SQL join . (default: None).
308
308
join_comparator (JoinComparatorEnum): A JoinComparatorEnum representing the comparator
309
309
used when joining the target feature in the base feature group and the feature
310
- in the target feature group (default: None ).
310
+ in the target feature group. (default: JoinComparatorEnum.EQUALS ).
311
311
join_type (JoinTypeEnum): A JoinTypeEnum representing the type of join between
312
- the base and target feature groups. (default: None ).
312
+ the base and target feature groups. (default: JoinTypeEnum.INNER_JOIN ).
313
313
Returns:
314
314
This DatasetBuilder object.
315
315
"""
@@ -985,27 +985,16 @@ def _construct_join_condition(self, feature_group: FeatureGroupToBeMerged, suffi
985
985
The JOIN query string.
986
986
"""
987
987
988
- join_type = (
989
- feature_group .join_type
990
- if feature_group .join_type is not None
991
- else JoinTypeEnum .INNER_JOIN
992
- )
993
-
994
- join_comparator = (
995
- feature_group .join_comparator
996
- if feature_group .join_comparator is not None
997
- else JoinComparatorEnum .EQUALS
998
- )
999
-
1000
988
feature_name_in_target = (
1001
989
feature_group .feature_name_in_target
1002
990
if feature_group .feature_name_in_target is not None
1003
991
else feature_group .record_identifier_feature_name
1004
992
)
1005
993
1006
994
join_condition_string = (
1007
- f"\n { join_type .value } fg_{ suffix } \n "
1008
- + f'ON fg_base."{ feature_group .target_feature_name_in_base } " { join_comparator .value } '
995
+ f"\n { feature_group .join_type .value } fg_{ suffix } \n "
996
+ + f'ON fg_base."{ feature_group .target_feature_name_in_base } "'
997
+ + f" { feature_group .join_comparator .value } "
1009
998
+ f'fg_{ suffix } ."{ feature_name_in_target } "'
1010
999
)
1011
1000
base_timestamp_cast_function_name = "from_unixtime"
0 commit comments