在L2中,我根据K2中的响应日期和J2中的截止日期寻找是或否答案。如果响应日期等于或早于截止日期,我希望L2读为“是”。如果回复日期晚于截止日期,那么我希望L2显示“否”。
答案 0 :(得分:1)
公式如下:
public static class ExtractWordsFn extends DoFn<String, String> {
@ProcessElement
public void processElement(ProcessContext c) {
final String regex = "MESSAGE:(.*)\\n\\[MESSAGE\\].*(\\\"entityName\\\":\\\"\\w+\\\")";
final Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
Matcher m = pattern.matcher(c.element());
List<String> entities = new ArrayList<String>();
while (m.find()) {
System.out.println("Full match: " + m.group(0));
for (int i = 1; i <= m.groupCount(); i++) {
entities.add(m.group(i));
}
}
// Output each word encountered into the output PCollection.
for (String entity : entities) {
c.output(entity);
}
}
}
如果我的问题正确,那么它应该有效。要检查K2是否为空,请使用以下公式:
=IF(K2<=J2,"Yes","No")