wu-sheng commented on code in PR #11731:
URL: https://github.com/apache/skywalking/pull/11731#discussion_r1443948273
##########
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/ColumnTypeEsMapping.java:
##########
@@ -28,13 +28,15 @@
public class ColumnTypeEsMapping {
- public String transform(Class<?> type, Type genericType, final
ElasticSearchExtension elasticSearchExtension) {
+ public String transform(Class<?> type, Type genericType, int length,
boolean storageOnly, final ElasticSearchExtension elasticSearchExtension) {
if (Integer.class.equals(type) || int.class.equals(type) ||
Layer.class.equals(type)) {
return "integer";
} else if (Long.class.equals(type) || long.class.equals(type)) {
return "long";
} else if (Double.class.equals(type) || double.class.equals(type)) {
return "double";
+ } else if (String.class.equals(type) && storageOnly && length > 32766)
{ // 32766 is the max length of a keywords field in ES
+ return "text";
Review Comment:
@kezhenxu94 @wankai123 This could be a hidden bug, in which length doesn't
apply eventually, and fails back to keyword type. The good part is, that this
would not break OAP booting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]