|
@@ -3113,6 +3113,53 @@ class f_generate_project_with_attrs_json(BaseUDTF):
|
|
|
project_json = to_project_json([_group])
|
|
|
self.forward(project_json)
|
|
|
|
|
|
+@annotate('string,string -> string,string,bigint,bigint')
|
|
|
+class f_fix_merge_filter(BaseUDTF):
|
|
|
+ '''
|
|
|
+ 将多个组拆解成多条记录
|
|
|
+ '''
|
|
|
+
|
|
|
+ def __init__(self):
|
|
|
+ import logging
|
|
|
+ import json
|
|
|
+ global json,logging
|
|
|
+ logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
|
+
|
|
|
+ def process(self,uuid,docids):
|
|
|
+ if docids is not None:
|
|
|
+ list_docid = [int(a) for a in docids.split(",")]
|
|
|
+ new_list_docid = []
|
|
|
+
|
|
|
+ for docid in list_docid:
|
|
|
+ if docid< 39400549900:
|
|
|
+ new_list_docid.append(str(docid))
|
|
|
+ if len(new_list_docid)==0:
|
|
|
+ self.forward(uuid,docids,0,500)
|
|
|
+ else:
|
|
|
+ if len(list_docid)!=len(new_list_docid):
|
|
|
+ self.forward(uuid,",".join(new_list_docid),len(new_list_docid),201)
|
|
|
+
|
|
|
+@annotate('string -> bigint,bigint')
|
|
|
+class f_fix_merge_rerun_document(BaseUDTF):
|
|
|
+ '''
|
|
|
+ 将多个组拆解成多条记录
|
|
|
+ '''
|
|
|
+
|
|
|
+ def __init__(self):
|
|
|
+ import logging
|
|
|
+ import json
|
|
|
+ global json,logging
|
|
|
+ logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
|
+
|
|
|
+ def process(self,docids):
|
|
|
+ if docids is not None:
|
|
|
+ list_docid = [int(a) for a in docids.split(",")]
|
|
|
+ docid = list_docid[0]
|
|
|
+ partitionkey = docid%500+1
|
|
|
+
|
|
|
+ self.forward(partitionkey,docid)
|
|
|
+
|
|
|
+
|
|
|
@annotate('string -> string')
|
|
|
class f_generate_project_with_delete_uuid(BaseUDTF):
|
|
|
'''
|