From f203b1147c57a22f87ce88d3aaf74abad9ea2a8d Mon Sep 17 00:00:00 2001 From: zhilingc Date: Mon, 6 Jan 2020 17:07:34 +0800 Subject: [PATCH] Rename columns --- .../resources/templates/single_featureset_pit_join.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/serving/src/main/resources/templates/single_featureset_pit_join.sql b/serving/src/main/resources/templates/single_featureset_pit_join.sql index 17d181ee79..c4da56f2f6 100644 --- a/serving/src/main/resources/templates/single_featureset_pit_join.sql +++ b/serving/src/main/resources/templates/single_featureset_pit_join.sql @@ -46,7 +46,15 @@ FROM `{{projectId}}.{{datasetId}}.{{ featureSet.project }}_{{ featureSet.name }} ) USING ({{ featureSet.project }}_{{ featureSet.name }}_v{{ featureSet.version }}_feature_timestamp, created_timestamp, {{ featureSet.entities | join(', ')}}) WHERE is_entity_table ) -SELECT * +SELECT + k.uuid as uuid, + k.event_timestamp as event_timestamp, + {% for entityName in featureSet.entities %} + k.{{ entityName }} as {{ entityName }}, + {% endfor %} + {% for featureName in featureSet.features %} + k.{{ featureName }} as {{ featureName }}{% if loop.last %}{% else %}, {% endif %} + {% endfor %} FROM ( SELECT ARRAY_AGG(row LIMIT 1)[OFFSET(0)] k FROM joined row