From 9adcb21b641849708ae6a438637accc7db57e132 Mon Sep 17 00:00:00 2001 From: Rakhi Agrawal Date: Tue, 10 Dec 2024 10:54:30 -0800 Subject: [PATCH] Fixing backfillRelationship for metadata_apsect (#486) * Updated * Added paranthesis * Small type --------- Co-authored-by: Rakhi Agrawal --- .../main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java b/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java index 6da573579..216aee78a 100644 --- a/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java +++ b/dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java @@ -1098,8 +1098,8 @@ private String batchGetSelect(@Nonnull String urn, @Nonnull String aspect, long outputParams.add(aspect); outputParams.add(version); - return String.format("SELECT t.urn, t.aspect, t.version, t.metadata, t.createdOn, t.createdBy, t.createdFor " - + "FROM %s t WHERE urn = ? AND aspect = ? AND version = ?", + return String.format("(SELECT t.urn, t.aspect, t.version, t.metadata, t.createdOn, t.createdBy, t.createdFor " + + "FROM %s t WHERE urn = ? AND aspect = ? AND version = ? ORDER BY t.createdOn DESC LIMIT 1)", EbeanMetadataAspect.class.getAnnotation(Table.class).name()); }