From eefab3dc1e158e3e62d76516d5735f18e1334cc0 Mon Sep 17 00:00:00 2001 From: Shuya Tsukamoto Date: Fri, 19 May 2017 15:14:39 +0900 Subject: [PATCH] Fix KeyError: static_boostring_score (#507) --- .../src/main/resources/jython/ElasticSearchIndex.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/metadata-etl/src/main/resources/jython/ElasticSearchIndex.py b/metadata-etl/src/main/resources/jython/ElasticSearchIndex.py index e23bd6c0ec..a7deb04397 100644 --- a/metadata-etl/src/main/resources/jython/ElasticSearchIndex.py +++ b/metadata-etl/src/main/resources/jython/ElasticSearchIndex.py @@ -148,7 +148,14 @@ class ElasticSearchIndex(): def update_dataset(self, last_unixtime=None): if last_unixtime: sql = """ - SELECT * FROM dict_dataset WHERE from_unixtime(modified_time) >= DATE_SUB(from_unixtime(%f), INTERVAL 1 HOUR) + SELECT d.*, + COALESCE(s.static_boosting_score,1) as static_boosting_score + FROM dict_dataset d + LEFT JOIN cfg_search_score_boost s + ON d.id = s.id + WHERE d.urn not like "hive:///dev_foundation_tables%%" + and d.urn not like "hive:///dev_foundation_views%%" + and from_unixtime(d.modified_time) >= DATE_SUB(from_unixtime(%f), INTERVAL 1 HOUR) """ % last_unixtime else: sql = """