'''
json_map['key3'] as key3
.......
..
.....
......
json_map['key100'] as key100
from(
select json_map
from input_table,lateral table(json_tuple(json_str)) as T(json_map)
)
'''
I finally solved my problem through this method。this is json_tupe func
'''
public void eval(String jsonStr, String... keys) {
HashMap<String, String> result = new HashMap<>(keys.length);
if (jsonStr == null || jsonStr.isEmpty()) {
collect(result);
return;
}
try {
JsonNode jsonNode = objectMapper.readTree(jsonStr);
for (String key : keys) {
JsonNode valueNode = jsonNode.get(key);
if (valueNode != null) {
result.put(key, valueNode.asText());
}
}
collect(result);
} catch (Exception e) {
collect(result);
}
}
'''