from base.func_base.base_func import logging_more, is_void
from base.func_base.file import text_func, excel_func
from query.parser.es_parser import EsParser
if __name__ == '__main__':
sheets = excel_func.read_excel_sheets(r"E:\公司\数据表\1688无年份.xlsx")
sheet_ll = excel_func.get_sheet_ll(sheets[0])
head = sheet_ll[0]
@logging_more()
def __f(li):
return EsParser().index("dm_map_literature_1").select("_id").query({
"query": {
"terms": {
"pmid": [
li[0]
]
}
}
}).to_stream_view().map(lambda row: (row.get_by_name("_id"), {
"publish_year": li[1]
})).collect_as_list()
StreamView(sheet_ll[1:]).flatmap(__f).cache()
# write_to_es(index="dm_map_literature_1", node_enum=NodeEnum.TEST)
打赏作者